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.

100% private — runs in your browser

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

  1. Pick a preset, or choose the maps.
  2. Set the number of points and the seed.
  3. Choose one colour, shaded by density or coloured by map, the cell size and the colours.
  4. Or type your own maps, one per line, as a b c d e f p.
  5. Choose fill the page or a width and height.
  6. 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

MapabcdefChance pShare drawn (seed 1, 200,000 points)4 standard errors
f1 (stem)0000.16000.010.97 %±0.09 %
f2 (smaller leaflets)0.850.04−0.040.8501.60.8585.07 %±0.32 %
f3 (left leaflet)0.2−0.260.230.2201.60.076.97 %±0.23 %
f4 (right leaflet)−0.150.280.260.2400.440.076.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

PresetMapsPointsLookCellInked cellsDrawing size
Barnsley fern, 200,000 pointsBarnsley’s four maps (1988)200,000one colour0.3 mm64,099112.2 mm × 230 mm
Shaded by density, 1,000,000 pointsBarnsley’s four maps (1988)1,000,000density (6)0.3 mm96,762111.8 mm × 230 mm
Coloured by map: stem, leaflets, left, rightBarnsley’s four maps (1988)300,000by map0.3 mm74,224112.2 mm × 230 mm
Sparse: 20,000 pointsBarnsley’s four maps (1988)20,000one colour0.3 mm15,133112.5 mm × 230 mm
Fine: 2,000,000 points, 0.2 mm cellsBarnsley’s four maps (1988)2,000,000density (5)0.2 mm200,020111.5 mm × 230 mm
Black ink, 300,000 pointsBarnsley’s four maps (1988)300,000one colour0.3 mm74,224112.2 mm × 230 mm
Pale fern on a dark pageBarnsley’s four maps (1988)400,000density (4)0.3 mm81,089112 mm × 230 mm
Mirror imageMirror image (x → −x: b, c and e change sign)200,000one colour0.3 mm64,099112.2 mm × 230 mm
Equal chances: same set, filled unevenlySame four maps, equal chances (0.25 each)200,000density (6)0.3 mm8,100109.3 mm × 230 mm
Without the stem mapWithout the stem map (its 0.01 moved to map 2)200,000one colour0.3 mm61,680117.6 mm × 230 mm
Variant: shorter side leafletsVariant: side leaflets 0.8 × as long (maps 3 and 4)200,000one colour0.3 mm35,850101.5 mm × 230 mm
Real size 150 mm square frameBarnsley’s four maps (1988)300,000density (4)0.25 mm51,73470.2 mm × 144 mm
Real size 4 x 6 in frameBarnsley’s four maps (1988)300,000one colour0.3 mm40,6672.81 in × 5.76 in
Your own maps: three half-size maps (a triangle)typed (3 maps)100,000by map0.4 mm20,828178.5 mm × 154.5 mm

Counts and sizes are worked out by the tool on US Letter.

Map shares at other seeds

PointsSeedMap 1Map 2Map 3Map 4Worst gap from p
20,00010.98 %85.13 %6.88 %7.00 %0.64 σ
200,00010.97 %85.07 %6.97 %6.99 %1.17 σ
200,00020.98 %85.03 %6.98 %7.01 %0.88 σ
200,00030.98 %84.95 %7.02 %7.05 %1.08 σ
1,000,00011.00 %85.04 %6.96 %7.00 %1.67 σ
2,000,00071.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

PointsSeedxy
2,000,0001−2.1818 to 2.65580.0200 to 9.9982
2,000,0002−2.1819 to 2.65580.0110 to 9.9983
2,000,0003−2.1819 to 2.65580.0111 to 9.9983

Measured by the tool on the points it keeps (maps’ own units).

What prints

DownloadWhat is in it
PDFThe fern at real size as vector cell strips, with the seed, the map shares and a check bar
PNG 300 DPIThe same sheet as a picture
SVGThe same cell strips, at real size

To cut it, use SVG to DXF; for other fractals, the Fractal Generator.

Which tool to use

You wantUse
The Barnsley fern or your own affine mapsBarnsley Fern Generator (this page)
Mandelbrot and Julia sets, L-system curvesFractal Generator
The Sierpinski triangle by levels or the chaos gameSierpinski Triangle
Trees made of squaresPythagoras 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.

See all free tools →

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.