Generative ASCII art

Generative ASCII art is drawn by rules rather than sketched: a formula, a grid of cells or a swarm of particles runs forward in time, and the picture appears as a side effect. Here that means fractals zooming, cellular automata evolving, strange attractors folding, mazes carving themselves and tilings that never repeat, all rendered in characters.

Where to start

Text suits this work because each character cell is one sample of the system, much like the line printer art of early computing. Use these pieces on developer portfolios, in talks about maths, as social headers and as terminal welcomes, or study one to see how a few lines of logic produce so much structure.

Types of generative ASCII art: six families

The pieces fall into a few families, and each family has its own feel on a page:

  • Fractals: Mandelbrot Zoom, Julia Set, Sierpinski Triangle, Dragon Curve and Apollonian Gasket, shapes that repeat at every scale.
  • Cellular automata: Rule 30, Brian's Brain and Langton's Ant, plus the Game of Life at Game of Life, grids where each cell follows a simple rule about its neighbors.
  • Strange attractors: Lorenz Butterfly and Clifford Attractor, paths that never repeat yet never leave their shape.
  • Growth: Diffusion Aggregation, Space Colonisation Tree, L-System Plant, Crystal Grain Growth and Reaction Diffusion, forms that build up step by step.
  • Geometry and tiling: Penrose Growth, Truchet Tiles, Voronoi Cells, Hilbert Curve and Spirograph, order you can see.
  • Procedural and emergent: Maze Builder, Wave Function Collapse, Boids Over Meadow and Flow Field, where local choices add up to a whole.

How an ASCII fractal is drawn

The Mandelbrot set is the most famous ASCII fractal, and it maps neatly onto a grid of characters. For each cell, take the point it covers as a complex number c, start with z at zero and repeat z = z² + c. If z stays small, the point belongs to the set. If it escapes, the number of steps it took picks the character and color, so the boundary fills with fine detail, and a zoom simply shrinks the window each frame. A Julia set uses the same formula with c held fixed while the starting z varies across the grid. The Julia Set piece moves c along the edge of the main cardioid, which is why it morphs between spirals, dendrites and dust. Sierpinski Triangle uses the chaos game instead: a point hops halfway toward random corners and the triangle emerges from the noise.

Cellular automata and emergence from simple rules

Cellular automata show how complex behavior can come from tiny rules. In Rule 30, each new row is set by looking at three cells in the row above, and a single starting cell grows into chaotic triangles. Langton's Ant turns one way on a light square and the other way on a dark one, flipping each square as it leaves, and a single ant eventually builds an orderly highway out of the mess. Brian's Brain gives cells three states, firing, refractory and resting, so waves and gliders sweep the grid without settling. Boids Over Meadow applies the same thinking to birds: separation, alignment and cohesion are enough for a flock to split and regroup around a diving hawk. For the best known automaton of all, see the Game of Life at Game of Life.

Using generative pieces on pages, headers and terminals

Generative pieces are abstract, so they sit well behind headlines and in wide formats. Flow Field, Truchet Tiles and Voronoi Cells export straight to the X header, LinkedIn banner and GitHub social preview sizes. Mandelbrot Zoom, Clifford Attractor and Penrose Growth make striking heroes for a developer portfolio or the title slide of a maths talk. Rule 30, Hilbert Curve, Maze Builder and Brian's Brain are tagged for terminals: run npx --yes https://www.ascii-magic.com/ascii/cli.tgz rule-30 to watch it scroll, or add --frame to print one still frame for a file header. The Binary look turns any automaton into ones and zeros, and the Lines look gives Hilbert Curve the feel of a circuit board.

Ways to use ASCII algorithms

Step-by-step guides with a live builder and code to copy.

All 18 use cases →

/FAQS

ASCII algorithms: frequently asked questions

Answers about using ASCII algorithms on websites, in READMEs, in terminals and in exports.

Q. What is generative ASCII art?
Generative ASCII art is text art produced by a set of rules, such as a formula, a cellular automaton or a particle system, rather than placed character by character. The code decides what goes in each cell over time, so the image can grow, evolve and loop on its own. This category collects pieces built this way.
Q. How is generative ASCII art different from converting an image to ASCII?
Converting an image maps the brightness of an existing picture onto characters, while generative art has no source picture at all. The structure comes from maths and rules, which is why a fractal keeps revealing new detail as it zooms. To convert your own image or video, use the ASCII Magic editor at ASCII Magic editor.
Q. Where can I find an animated ASCII fractal?
This category has several: Mandelbrot Zoom, Julia Set, Sierpinski Triangle, Dragon Curve, Apollonian Gasket and the L-System Plant. Each plays live in the browser and exports as a GIF, a video or a 4K wallpaper. For a fractal in a natural setting, see Fern Fractal at Fern Fractal in Weather & Wild.
Q. How does the ASCII Mandelbrot zoom work?
Each character cell is treated as a point on the complex plane and run through z = z² + c until it escapes or hits a step limit. The step count picks the character and color, and the view shrinks a little every frame. Mandelbrot Zoom dives into the seahorse valley this way, then drifts back out.
Q. What is the difference between the Mandelbrot set and a Julia set?
They use the same formula, but the Mandelbrot set varies c across the image while a Julia set fixes c and varies the starting point. Every point inside the Mandelbrot set corresponds to a connected Julia set. The Julia Set piece slides c along the edge of the main cardioid, so its shape morphs continuously.
Q. Which cellular automata are in the collection?
Rule 30, Brian's Brain and Langton's Ant are here, along with the Game of Life at Game of Life. Each runs on a grid where every cell follows a simple rule about its neighbors, and the patterns that emerge are surprisingly rich. Several are tagged for terminals, so they also play well with npx --yes https://www.ascii-magic.com/ascii/cli.tgz.
Q. What is Rule 30?
Rule 30 is an elementary cellular automaton: a row of cells where each new cell depends only on itself and its two neighbors in the row above. Starting from one live cell, it produces a chaotic triangle that never settles into a simple repeating pattern. The Rule 30 piece grows it from a single cell and scrolls it upward.
Q. What is a strange attractor?
A strange attractor is the shape a chaotic system settles onto: the path never repeats, yet it always stays within the same folded form. Lorenz Butterfly traces the two wings of the Lorenz attractor in 3D, and Clifford Attractor draws a glowing density map whose four parameters drift so its folds keep reshaping.
Q. How does wave function collapse generate a map?
Wave function collapse starts with every cell able to become any tile, then repeatedly picks the cell with the fewest options left and fixes it. Each choice narrows what its neighbors can become, so the rules ripple across the grid until the map is complete. The Wave Function Collapse piece solves a terrain map this way.
Q. What is diffusion-limited aggregation?
Diffusion-limited aggregation is a growth process where particles wander at random and stick the moment they touch a growing cluster. Because the outer tips catch most of the wanderers, the cluster branches like frost, coral or lightning. Diffusion Aggregation builds one this way, a single particle at a time drifting in from the dark.
Q. Can I use generative ASCII art as a social media header?
Yes, every piece page exports PNGs at the exact sizes for an X header, a LinkedIn banner and a GitHub social preview. Wide, abstract pieces such as Flow Field, Truchet Tiles and Voronoi Cells work best, since there is no central subject to lose at the edges. The social headers guide at ASCII art headers for X, LinkedIn and GitHub walks through it.
Q. Can I print a fractal as text in my terminal?
Yes, run npx --yes https://www.ascii-magic.com/ascii/cli.tgz mandelbrot-zoom to play it in color, or add --frame to print one still frame and exit. A still frame is handy for a message of the day or the top of a log file. Add --look=dots to redraw it in halftone dots instead of the default characters.

Related categories

All categories