Maze and Greek key pattern generator
Two classics of line ornament. Grow a maze whose corridors continue across the edges of the tile, or draw the Greek key, the rectangular spiral border of ancient Greece. Adjust the sizes and colours, and export a seamless pattern as SVG, PNG or CSS.
Open in the generator How it works
Mazes and the Greek key
A perfect maze has exactly one route between any two cells: no loops and no closed-off rooms. It is the kind of maze printed in puzzle books, and it makes a restless, textured pattern when you look at it as a whole.
The Greek key, or meander, is a border of rectangular spirals hooked onto a running line, used in Greek vase painting and architecture from antiquity. The name comes from the Maeander, a winding river in Asia Minor. Line width equals the corridor width, which gives the key its regular rhythm.
How the generator builds them
The maze is carved by a randomised depth-first search: starting from one cell, the algorithm moves to a random unvisited neighbour, breaking the wall between them, and backtracks when it is stuck. The grid wraps around like a torus, so the corridors that leave the tile on one side re-enter on the opposite side, and the pattern is seamless. The same seed always gives the same maze.
The meander is built from a rectangular spiral with the number of turns you choose. Rows of the key are stacked with a gap between them, and an optional line runs along the top edge.
What you can adjust
- Kind — maze or meander (Greek key).
- Cells per period — how many cells a maze has per side.
- Draw — rounded paths, or walls.
- Path width — thin corridors to broad ones.
- Spiral turns — one to five turns in the Greek key.
- Top edge and gap between rows — the border line and the spacing of the key rows.
- Another maze — a new random layout.
- Colours — any palette.
Export and use
Download the seamless tile as PNG or SVG, or copy a ready CSS background. The patterns you create are free to use, personally or commercially.