Barnsley Fern Generator
Draw the Barnsley fern: a fern-shaped picture made by four simple maps. Each map moves a point by x → a x + b y + e, y → c x + d y + f; the tool starts at (0, 0), picks one of the four maps at random with its own chance (1 %, 85 %, 7 % and 7 %), moves the point, and repeats up to 2 million times. The points settle on the fern: the stem, the smaller and smaller leaflets up the frond, and the largest left and right leaflets. The maps are the ones in Michael Barnsley’s 1988 book Fractals Everywhere. Show the fern in one colour, shaded by how many points land in each cell, or coloured by the map that made each part; try the mirror image, equal chances, no stem, or type your own maps. It prints at real size, filling the page or a frame of the width and height you type. Download a PDF, a 300 DPI PNG or an SVG. Nothing is uploaded.
100% private — everything runs in your browser. Everything runs in your browser; nothing is uploaded.
Print at 100% (Actual size): the design prints at real size. The SVG holds the inked cells as strips.
Maps
Look
Size
Page
Runs in your browser with our own code: nothing you type is uploaded or saved. Every point comes from the maps by our own code; typed numbers are read by a strict number check, never run as code. You may use what you make here, including commercially, with no credit needed.
How to make and print a Barnsley fern
- Pick a preset, or choose the maps.
- Set the number of points and the seed.
- Choose one colour, shaded by density or coloured by map, the cell size and the colours.
- Or type your own maps, one per line, as a b c d e f p.
- Choose fill the page or a width and height.
- Download the PDF and print at 100% (Actual size), or the PNG or SVG.
What you can use it for
- Maths lessons on fractals, affine maps and iterated function systems
- Botanical-style prints and posters
- Covers, cards and stationery backgrounds
- Checking a chaos-game program against known map shares
- Laser and vinyl art from the SVG cells
- Colouring the parts each map draws
The four maps
| Map | a | b | c | d | e | f | Chance p | Share drawn (seed 1, 200,000 points) | 4 standard errors |
|---|---|---|---|---|---|---|---|---|---|
| f1 (stem) | 0 | 0 | 0 | 0.16 | 0 | 0 | 0.01 | 0.97 % | ±0.09 % |
| f2 (smaller leaflets) | 0.85 | 0.04 | −0.04 | 0.85 | 0 | 1.6 | 0.85 | 85.07 % | ±0.32 % |
| f3 (left leaflet) | 0.2 | −0.26 | 0.23 | 0.22 | 0 | 1.6 | 0.07 | 6.97 % | ±0.23 % |
| f4 (right leaflet) | −0.15 | 0.28 | 0.26 | 0.24 | 0 | 0.44 | 0.07 | 6.99 % | ±0.23 % |
Maps and chances from Wikipedia’s Barnsley fern page (read 13 November 2026), credited there to M. Barnsley, Fractals Everywhere, 1988. Shares are counted by the tool.
The 14 presets
| Preset | Maps | Points | Look | Cell | Inked cells | Drawing size |
|---|---|---|---|---|---|---|
| Barnsley fern, 200,000 points | Barnsley’s four maps (1988) | 200,000 | one colour | 0.3 mm | 64,099 | 112.2 mm × 230 mm |
| Shaded by density, 1,000,000 points | Barnsley’s four maps (1988) | 1,000,000 | density (6) | 0.3 mm | 96,762 | 111.8 mm × 230 mm |
| Coloured by map: stem, leaflets, left, right | Barnsley’s four maps (1988) | 300,000 | by map | 0.3 mm | 74,224 | 112.2 mm × 230 mm |
| Sparse: 20,000 points | Barnsley’s four maps (1988) | 20,000 | one colour | 0.3 mm | 15,133 | 112.5 mm × 230 mm |
| Fine: 2,000,000 points, 0.2 mm cells | Barnsley’s four maps (1988) | 2,000,000 | density (5) | 0.2 mm | 200,020 | 111.5 mm × 230 mm |
| Black ink, 300,000 points | Barnsley’s four maps (1988) | 300,000 | one colour | 0.3 mm | 74,224 | 112.2 mm × 230 mm |
| Pale fern on a dark page | Barnsley’s four maps (1988) | 400,000 | density (4) | 0.3 mm | 81,089 | 112 mm × 230 mm |
| Mirror image | Mirror image (x → −x: b, c and e change sign) | 200,000 | one colour | 0.3 mm | 64,099 | 112.2 mm × 230 mm |
| Equal chances: same set, filled unevenly | Same four maps, equal chances (0.25 each) | 200,000 | density (6) | 0.3 mm | 8,100 | 109.3 mm × 230 mm |
| Without the stem map | Without the stem map (its 0.01 moved to map 2) | 200,000 | one colour | 0.3 mm | 61,680 | 117.6 mm × 230 mm |
| Variant: shorter side leaflets | Variant: side leaflets 0.8 × as long (maps 3 and 4) | 200,000 | one colour | 0.3 mm | 35,850 | 101.5 mm × 230 mm |
| Real size 150 mm square frame | Barnsley’s four maps (1988) | 300,000 | density (4) | 0.25 mm | 51,734 | 70.2 mm × 144 mm |
| Real size 4 x 6 in frame | Barnsley’s four maps (1988) | 300,000 | one colour | 0.3 mm | 40,667 | 2.81 in × 5.76 in |
| Your own maps: three half-size maps (a triangle) | typed (3 maps) | 100,000 | by map | 0.4 mm | 20,828 | 178.5 mm × 154.5 mm |
Counts and sizes are worked out by the tool on US Letter.
Map shares at other seeds
| Points | Seed | Map 1 | Map 2 | Map 3 | Map 4 | Worst gap from p |
|---|---|---|---|---|---|---|
| 20,000 | 1 | 0.98 % | 85.13 % | 6.88 % | 7.00 % | 0.64 σ |
| 200,000 | 1 | 0.97 % | 85.07 % | 6.97 % | 6.99 % | 1.17 σ |
| 200,000 | 2 | 0.98 % | 85.03 % | 6.98 % | 7.01 % | 0.88 σ |
| 200,000 | 3 | 0.98 % | 84.95 % | 7.02 % | 7.05 % | 1.08 σ |
| 1,000,000 | 1 | 1.00 % | 85.04 % | 6.96 % | 7.00 % | 1.67 σ |
| 2,000,000 | 7 | 1.01 % | 84.98 % | 7.01 % | 7.00 % | 0.97 σ |
The last column is the largest gap between a share and its chance, in standard errors √(p(1 − p)/N).
The box the points stay in
| Points | Seed | x | y |
|---|---|---|---|
| 2,000,000 | 1 | −2.1818 to 2.6558 | 0.0200 to 9.9982 |
| 2,000,000 | 2 | −2.1819 to 2.6558 | 0.0110 to 9.9983 |
| 2,000,000 | 3 | −2.1819 to 2.6558 | 0.0111 to 9.9983 |
Measured by the tool on the points it keeps (maps’ own units).
What prints
| Download | What is in it |
|---|---|
| The fern at real size as vector cell strips, with the seed, the map shares and a check bar | |
| PNG 300 DPI | The same sheet as a picture |
| SVG | The same cell strips, at real size |
To cut it, use SVG to DXF; for other fractals, the Fractal Generator.
Which tool to use
| You want | Use |
|---|---|
| The Barnsley fern or your own affine maps | Barnsley Fern Generator (this page) |
| Mandelbrot and Julia sets, L-system curves | Fractal Generator |
| The Sierpinski triangle by levels or the chaos game | Sierpinski Triangle |
| Trees made of squares | Pythagoras Tree |
Other tools: the Fractal Generator draws Mandelbrot and Julia sets, and the Tessellation Maker repeating tiles.
More free tools
Maths art and printables?
Drawing and print tools that run privately in your browser, with no sign-up and no watermark.
Frequently asked questions
What is the Barnsley fern?
A picture of a fern made by an iterated function system: four affine maps, each of which shrinks, turns and moves the plane. Applying a randomly chosen map again and again to one point makes the point visit the fern and nothing else. The four maps were published by Michael Barnsley in Fractals Everywhere (1988).
What are the four maps?
Each map sends (x, y) to (a x + b y + e, c x + d y + f). The table below gives the numbers: f1 draws the stem, f2 makes each smaller copy further up the frond, f3 and f4 make the largest left and right leaflets. The chances are 0.01, 0.85, 0.07 and 0.07.
How does the chaos game work?
Start at (0, 0). Draw a random number between 0 and 1, pick the map whose slice of 0 to 1 it falls in (the slices are the chances), move the point with that map, and record it. The tool drops the first 20 points and keeps the number you ask for; a seed makes the same random numbers, so the same seed gives the same picture.
Do the maps really get picked with those chances?
Yes. The tool counts which map made each point, shows the shares under the options and in the footer, and our tests check them: with 200,000 points every share is within 4 standard errors of its chance (tables below).
How big is the fern?
In the maps’ own units, the points the tool draws stay inside x from about −2.18 to 2.66 and y from 0 to about 10 (the table shows the measured box for 2 million points). The tool scales that box to fit the frame and prints the drawing size in the footer.
What does equal chances do?
The fern is the same set of points whatever the chances, as long as each is above 0. The chances only change how often each part is visited: with 0.25 each, the stem gets far too many points and the tips of the frond far too few, so the picture looks thin.
Can I type my own maps?
Yes: 2 to 8 maps, one per line, as seven numbers a b c d e f p. The chances must add up to 1 and a to f must be between −10 and 10. The tool reads only numbers (nothing is run as code) and stops with a message if the points run away.
Is this the same as the Fern in the fractal generator?
No. That preset is a Julia set with c = 0 + 0.8i, made by repeating z → z² + c. This page draws the Barnsley fern from its four affine maps.
Is it free?
Yes. There is no sign-up, no watermark and no limit.
Is anything uploaded?
No. Every point and circle is worked out by JavaScript in your browser. Nothing you type is sent anywhere or saved when you close the page.