Wave Function Collapse

Fill a grid with tiles that always fit together, using the simple tiled model of the wave function collapse algorithm, and print the result. Each tile has a label on each side, called a socket, and two tiles may touch only where their sockets match. The tool starts with every tile allowed in every cell, then again and again picks the cell with the fewest likely choices, places a tile there at random (from the seed) and removes every tile that no longer fits from the cells around it. Choose one of 6 own tile sets (pipes, roads, circuit-like lines, loops, knots and a land-and-water coast), a grid of up to 60 × 60, open, closed or wrap-round edges and the seed. If the grid runs into a dead end the tool says so and tries the next seed. 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). Real size prints on one sheet when the drawing fits; the check bar in the footer lets you confirm the scale. The SVG holds the drawing at the printed size.

Tiles

Look

Page

Runs in your browser with our own code: nothing you type is uploaded or saved. Every tile is placed by our own code from the sockets and the seed shown. You may use what you make here, including commercially, with no credit needed.

How to make and print a wave function collapse pattern

  1. Pick a preset, or choose a tile set.
  2. Set the columns, rows and edges: open, closed (nothing leaves the grid) or wrap round (a seamless tile).
  3. Set the seed and how many tries to allow, and wait for the preview.
  4. Choose the line width, colour and grid lines; choose Fitted to one page or Real size and the paper.
  5. Download the PDF and print at 100% (Actual size), or the PNG or SVG.

What you can use it for

  • Generative art posters and prints
  • Seamless pattern tiles for fabric, wrapping paper and backgrounds
  • Lessons on constraint solving and procedural generation
  • Board-game and tabletop map tiles
  • Plotter, laser and vinyl art from the SVG
  • Checking a tile set idea before coding your own solver (same seed, same grid)

The 14 presets

PresetTile setGridEdgesSeedTries usedTiles (with turns)Bad joins
Pipes, 20 × 14, open edgesPipes20 × 14open11160
Pipes, 20 × 14, closed edges (no line leaves the grid)Pipes20 × 14closed21160
Pipes, 16 × 16 seamless tile (edges wrap round)Pipes16 × 16wrap round31160
Roads, 18 × 13, closed edgesRoads18 × 13closed41120
Roads, 36 × 26, open edgesRoads36 × 26open51120
Circuit-like lines, 24 × 18, open edgesCircuit-like lines24 × 18open61160
Circuit-like lines, 20 × 20 seamless tileCircuit-like lines20 × 20wrap round71160
Loops, 20 × 14, closed edges (every line closes up)Loops20 × 14closed8170
Knots, 16 × 12, closed edgesKnots16 × 12closed93 (seed 11)110
Knots, 14 × 14 seamless tileKnots14 × 14wrap round106 (seed 15)110
Coast, 24 × 18, open edgesCoast24 × 18open111160
Coast, 20 × 20 seamless tileCoast20 × 20wrap round121160
Pipes, 50 × 40 (the biggest preset)Pipes50 × 40open131160
Pipes at real size: 12 × 16 at 1 cm per cellPipes12 × 16closed141160

Tries used, the solving seed and the bad-join count are worked out by the tool; a bad join is a pair of touching sockets that differ.

The tile sets

SetTilesWith turnsClosed-edge socket
Pipes (lines with caps)blank, end, straight, corner, tee, cross16socket 0
Roads (filled bands)blank, straight, corner, tee, cross12socket 0
Circuit-like lines (pads at ends and crossings)blank, end, straight, corner, tee, cross16socket 0
Loops (straights and corners only, no ends)blank, straight, corner7socket 0
Knots (arcs and over-under crossings)blank, arc, double arc, crossing, straight11socket 0
Coast (land and water corners)land, shore, water16none (corners)

All tile sets and drawings are our own.

Checks

CheckResult in our tests
Every touching pair, every presetsockets match (own check, edges per mode)
240 single-try runs, all sets and edges236 solved, 4 contradictions reported, 0 bad grids
Same seed twicethe same grid, cell for cell
Turned tilessockets and drawings turned together
Wrap roundleft column fits the right, top row fits the bottom

What prints

DownloadWhat is in it
PDFThe grid fitted to one page or at real size, vector, with the tile set, the seed, the tries used and a check bar
PNG 300 DPIThe same sheet as a picture
SVGThe grid at the printed size: lines as one stroked path, fills as one filled path

For a cutter that needs DXF, use SVG to DXF.

Which tool to use

You wantUse
Tiles that fit by edge rulesWave Function Collapse (this page)
Random diagonal and arc tilesTruchet Tiles
A maze with one pathMaze Generator
Drawing your own picture on a gridPixel Art Maker
Stitch lines from a binary ruleHitomezashi

Other tools: Truchet Tiles for random arc tiles, the Maze Generator for mazes and the Pixel Art Maker for your own grid pictures.

More free tools

Grids, patterns 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 wave function collapse?

A way to fill a grid so that every neighbour fits a set of rules. Maxim Gumin published his WaveFunctionCollapse repository in 2016 (the Wikipedia article on model synthesis, read 13 November 2026, gives the year and notes Paul Merrell’s earlier model synthesis work from 2007). The name is borrowed from physics; the algorithm is plain constraint solving and this tool makes no physics claim.

What is the simple tiled model?

The version of the algorithm that starts from a list of tiles and which tiles may sit next to which, rather than learning patterns from a sample picture (the overlapping model, which this tool does not include). Here the rule is sockets: tile A may sit left of tile B when A’s right socket equals B’s left socket, and above it when A’s bottom socket equals B’s top socket.

How does it choose where to put a tile?

Among the cells that still have more than one tile allowed, it takes the one with the lowest Shannon entropy of the tile weights: ln(total weight) minus the sum of w ln w divided by the total. A tiny seeded number per cell breaks ties. It then picks one of that cell’s tiles at random in proportion to the weights, and removes every tile from the neighbouring cells that no longer fits, spreading out until nothing changes.

What is a contradiction?

A cell left with no tile that fits. When that happens the tool starts again with the next seed, up to the number of tries you allow, and reports which seed worked. If every try fails it says so and draws nothing: it never prints a grid with a bad join. In our tests 236 of 240 single-try runs over all sets and edges finished and 4 ended in a contradiction, and every finished grid had every pair of touching sockets matching.

Why can two seeds give the same grid?

Because a contradiction moves on to the next seed. The knots preset starts at seed 9 and solves on try 3, with seed 11; a run starting at seed 10 would end on the same seed and the same grid.

What are the edge settings?

Open puts no rule on the outer edge, so lines may run off the grid. Closed allows only the empty socket on the outer edge, so every line stays inside (the coast set has no closed option). Wrap round makes the left edge touch the right edge and the top touch the bottom, so the result repeats as a seamless tile; our tests check both joins.

How are the tiles turned?

Tiles marked with 2 or 4 turns are also used turned 90° clockwise, with their sockets moving from top to right to bottom to left. The table on this page lists each set’s tiles and how many there are with their turns; our tests check that every turned copy’s drawing reaches exactly the sides whose socket says a line is there.

What is the coast set?

16 tiles that each mark their four corners as land or water. A side’s socket is its two corners, so touching tiles always agree on the corners they share, and the water is drawn by joining the middles of the sides where land meets water. Our tests check the water area of every tile.

How big can it go?

Grids up to 60 × 60 and up to 50 tries; every preset solves in under 2 seconds in our tests.

Can it print at real size?

Yes, when the drawing fits on one sheet: choose Real size and set the cell size. Every printed line and fill is within 0.2 mm of its true place in our tests, on US Letter and A4, as long as you print at 100% (Actual size); the check bar in the footer lets you confirm the scale. Bigger drawings print fitted to the page.

Is it free?

Yes. There is no sign-up, no watermark and no limit.

Is anything uploaded?

No. Every tile is placed by JavaScript in your browser. Nothing you type is sent anywhere or saved when you close the page.