Fractals — ASCII Mandelbrot

Try it live →

fract_text is a small C program that draws the Mandelbrot set in a terminal with ncurses, one character per point. Recently I used an AI agent to port it to a single self-contained HTML page. The math is computed in client-side JavaScript and the image is sized to fill the window.

The default view

The default view

Origins

I wrote the original in 1999 as a student at Boise State University. I developed it on Onyx, a dual-processor HP-UX machine, working from an X terminal running FVWM in a windowless computer lab in the Math and Geosciences building.

Same math as the C original

The port keeps mandelbrot.c’s math and character mapping:

  • A point escapes once |z|² ≥ 4, with a limit of 256 iterations.
  • Each escaped point is drawn as the character (iter % 94) + 33, which cycles through the printable ASCII range from ! to ~.
  • Points that never escape are left blank.

The view starts at the original region (real −2.3 to 1.3, imaginary −1.5 to 1.5), widened to match the window’s aspect ratio.

Zoomed in

Zoomed in

Zoomed in

Zoomed in

Zoomed in

Zoomed in

See also the 24-bit color version.