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.
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
- Pick a preset, or choose a tile set.
- Set the columns, rows and edges: open, closed (nothing leaves the grid) or wrap round (a seamless tile).
- Set the seed and how many tries to allow, and wait for the preview.
- Choose the line width, colour and grid lines; choose Fitted to one page or Real size and the paper.
- 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
| Preset | Tile set | Grid | Edges | Seed | Tries used | Tiles (with turns) | Bad joins |
|---|---|---|---|---|---|---|---|
| Pipes, 20 × 14, open edges | Pipes | 20 × 14 | open | 1 | 1 | 16 | 0 |
| Pipes, 20 × 14, closed edges (no line leaves the grid) | Pipes | 20 × 14 | closed | 2 | 1 | 16 | 0 |
| Pipes, 16 × 16 seamless tile (edges wrap round) | Pipes | 16 × 16 | wrap round | 3 | 1 | 16 | 0 |
| Roads, 18 × 13, closed edges | Roads | 18 × 13 | closed | 4 | 1 | 12 | 0 |
| Roads, 36 × 26, open edges | Roads | 36 × 26 | open | 5 | 1 | 12 | 0 |
| Circuit-like lines, 24 × 18, open edges | Circuit-like lines | 24 × 18 | open | 6 | 1 | 16 | 0 |
| Circuit-like lines, 20 × 20 seamless tile | Circuit-like lines | 20 × 20 | wrap round | 7 | 1 | 16 | 0 |
| Loops, 20 × 14, closed edges (every line closes up) | Loops | 20 × 14 | closed | 8 | 1 | 7 | 0 |
| Knots, 16 × 12, closed edges | Knots | 16 × 12 | closed | 9 | 3 (seed 11) | 11 | 0 |
| Knots, 14 × 14 seamless tile | Knots | 14 × 14 | wrap round | 10 | 6 (seed 15) | 11 | 0 |
| Coast, 24 × 18, open edges | Coast | 24 × 18 | open | 11 | 1 | 16 | 0 |
| Coast, 20 × 20 seamless tile | Coast | 20 × 20 | wrap round | 12 | 1 | 16 | 0 |
| Pipes, 50 × 40 (the biggest preset) | Pipes | 50 × 40 | open | 13 | 1 | 16 | 0 |
| Pipes at real size: 12 × 16 at 1 cm per cell | Pipes | 12 × 16 | closed | 14 | 1 | 16 | 0 |
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
| Set | Tiles | With turns | Closed-edge socket |
|---|---|---|---|
| Pipes (lines with caps) | blank, end, straight, corner, tee, cross | 16 | socket 0 |
| Roads (filled bands) | blank, straight, corner, tee, cross | 12 | socket 0 |
| Circuit-like lines (pads at ends and crossings) | blank, end, straight, corner, tee, cross | 16 | socket 0 |
| Loops (straights and corners only, no ends) | blank, straight, corner | 7 | socket 0 |
| Knots (arcs and over-under crossings) | blank, arc, double arc, crossing, straight | 11 | socket 0 |
| Coast (land and water corners) | land, shore, water | 16 | none (corners) |
All tile sets and drawings are our own.
Checks
| Check | Result in our tests |
|---|---|
| Every touching pair, every preset | sockets match (own check, edges per mode) |
| 240 single-try runs, all sets and edges | 236 solved, 4 contradictions reported, 0 bad grids |
| Same seed twice | the same grid, cell for cell |
| Turned tiles | sockets and drawings turned together |
| Wrap round | left column fits the right, top row fits the bottom |
What prints
| Download | What is in it |
|---|---|
| The 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 DPI | The same sheet as a picture |
| SVG | The 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 want | Use |
|---|---|
| Tiles that fit by edge rules | Wave Function Collapse (this page) |
| Random diagonal and arc tiles | Truchet Tiles |
| A maze with one path | Maze Generator |
| Drawing your own picture on a grid | Pixel Art Maker |
| Stitch lines from a binary rule | Hitomezashi |
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.
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.