Skip to main content

Mandelbrot generator with JavaScript

Fractals are fascinating!

Hugely complex structures can be generated from relatively simple algorithms. The key component to fractals is self reference and recursion.

One of the most recognised fractals is the one below generated from the Mandelbrot set.

I threw some rough JavaScript together to generate the set of complex numbers, using the real and imaginary parts of the complex number as the x/y coordinates.

The Mandlebrot set is actually the distinctive central black area. The coloured points are numbers out with the set; their colour is determined by how quickly (number of iterations) they leave the set.

See the Pen Mandelbrot fractal with colour by Lee Gunn (@leegunn) on CodePen.

Hello, my name is Lee and I work as a full-stack web developer specialising in Microsoft ASP.NET technologies. I love using Umbraco and also MANAGED, my own application management software.

Contact me at

All skills


Get in touch to talk about your project or just ask me a question.