Maze
Time
0:00.0
Moves
0
Shortest
–
Best
–
You escaped!
12×12 · Winding
Swipe or drag on the maze to steer, tap toward where you want to go, or use the arrows
Settings and printing
Print this maze
A clean black-and-white copy, with gaps at the start and the exit.
Play maze games online
This free maze game makes a brand-new random maze every time you play, so you never solve the same one twice. You're the blue dot in the top-left corner, and the exit is the green square in the bottom-right. Every maze is a "perfect" maze, with exactly one route between any two squares and no loops, so the way out always exists. Choose from five sizes, from a quick 8 × 8 to a 32 × 32 marathon, and four styles made by different maze-generation algorithms. Play with the arrow keys, by swiping on a phone or with the on-screen arrows. Race the clock, try the daily maze that's the same for everyone, switch on fog for a real challenge, or print a maze for later.
How to play
- Pick a size and a style, or choose Daily for today's maze.
- Look the maze over. The clock doesn't start until your first move.
- Move toward the exit. Walls block you, and by default each move glides along the corridor until the next junction, so long passages take a single press.
- Reach the green exit to finish. You'll see your time, your moves and the length of the shortest route, and a new best time is saved for that size and style.
- Press New for another maze, or Share to send a friend the exact maze you just played.
Controls
| Device | How to move |
|---|---|
| Keyboard | Arrow keys or W, A, S, D. Hold Shift for a single square (or a whole corridor if Glide is off). H shows a hint. |
| Phone or tablet | Swipe on the maze, or keep your finger down and drag to steer round several corners. Tap toward where you want to go, or use the arrow buttons; hold one to keep moving. |
| Mouse | Click on the maze in the direction you want to go, or drag to steer. |
Moves count squares, so gliding down a five-square corridor adds five moves. That keeps the move count fair whichever way you play, and the smallest possible count is always the length of the shortest route.
Maze sizes
| Size | Squares | Typical shortest route (Winding) |
|---|---|---|
| Easy · 8×8 | 64 | about 25 squares |
| Medium · 12×12 | 144 | about 47 squares |
| Hard · 16×16 | 256 | about 80 squares |
| Expert · 24×24 | 576 | about 144 squares |
| Huge · 32×32 | 1,024 | about 247 squares |
Four maze styles
Every style makes a perfect maze, but the algorithm behind it gives each one a different feel. The figures below come from 120 mazes of 16 × 16 squares made by this game's own generator.
| Style | Algorithm | Dead ends | Shortest route | What it's like |
|---|---|---|---|---|
| Winding | Recursive backtracker | 11% of squares | about 78 squares | Long, winding corridors and few dead ends. The route is long, but wrong turns are long too, so each junction deserves a moment's thought. |
| Branchy | Prim's algorithm | 35% of squares | about 33 squares | Grows outward from one point, leaving lots of short dead ends. Easy to start, fiddly to finish. |
| Patchwork | Kruskal's algorithm | 30% of squares | about 43 squares | Joins random patches of the grid together. Plenty of short dead ends and a medium-length route. |
| Unbiased | Wilson's algorithm | 29% of squares | about 43 squares | Every possible maze of the grid is equally likely, so it has no built-in style at all. |
Winding (the recursive backtracker) wanders from square to square, knocking down walls, and backs up only when it's boxed in, which is why its corridors are so long. Branchy (Prim's algorithm) grows the maze outward from a single square, always adding a random square on its edge. Patchwork (Kruskal's algorithm) knocks down walls in random order across the whole grid, skipping any wall that would create a loop. Unbiased (Wilson's algorithm) takes random walks and erases any loops they make; it's slower, but it's the only one of the four where every possible maze is equally likely.
How to solve a maze
- Plan before you move. The whole maze is visible and the clock waits, so trace a route with your eyes first, then run it.
- Work backwards from the exit. The route is often easier to see from the other end, especially in Winding mazes.
- Fill in dead ends. Any corridor that ends in a closed square can't be part of the route. Mentally fill them in, and what's left is the way out. This works best on Branchy and Patchwork mazes, which are full of short dead ends.
- Use the wall follower when lost. Keep one hand on the same wall and walk. Because these mazes have no loops and the start and exit are on the outer wall, it always gets you out, just not by the shortest route.
- Let the trail remember for you. The shaded squares show where you've been and the line shows your current route, so you never explore the same dead end twice. It's the idea behind Trémaux's method, a 19th-century way of solving mazes by marking the passages you've walked.
- On a phone, steer with one drag. Keep your finger down and trace the corridors; each stretch of movement is another move.
Fog, hints, the daily maze and statistics
Fog hides everything except the squares within a couple of steps of you and the ones you've visited; the exit stays visible, so you know which way to aim. Hint draws the way out from where you are for three seconds; runs that use one don't set records. Daily gives everyone the same 16 × 16 maze each day, in a style that changes from day to day, and your first solve counts toward your daily streak. Stats keeps, for every size and style you've played, your mazes played and solved, your best time, and how many runs were perfect, with no wrong turns at all. Everything, including the maze you're in the middle of, is saved in this browser only.
Printable mazes
Want a maze on paper? Open Settings and printing and choose Print maze for a clean black-and-white copy with gaps marking the start and the exit, or Print with solution for an answer sheet with the route drawn in. On a phone, the print dialog can also save the maze as a PDF. Easy and Medium mazes suit young children; Expert and Huge make a satisfying puzzle for grown-ups with a pencil.
Perfect mazes and spanning trees
Think of each square as a dot and each opening between neighbouring squares as a line joining two dots. A perfect maze connects every dot without ever making a loop, which is exactly what mathematicians call a spanning tree. A tree with N dots always has N − 1 lines, so a 16 × 16 maze has exactly 255 openings, and between any two squares there is one and only one path. That's why every maze here can be solved, why the wall follower works, and why the shortest route is also the only route that never doubles back.
More puzzle games
If you like finding a way through, try Lights Out, the sliding puzzle or Minesweeper. For quick reflexes, steer a growing snake in Snake, or give your memory a workout with Memory Match.
Frequently asked questions
Does every maze have a solution?
Yes. Every maze here is a “perfect” maze: every square can be reached and there is exactly one route between any two squares, including the start and the exit. There are no loops and no sealed-off areas, whichever size and style you choose.
What's the difference between the maze styles?
They're made by different algorithms. Winding mazes (recursive backtracker) have long corridors, few dead ends and a long route. Branchy mazes (Prim's algorithm) are full of short dead ends. Patchwork (Kruskal's algorithm) and Unbiased (Wilson's algorithm) sit in between; Wilson's is special because every possible maze of that size is equally likely to come up.
How big are the mazes?
Easy is 8 × 8 squares, Medium 12 × 12, Hard 16 × 16, Expert 24 × 24 and Huge 32 × 32. Changing the size or style starts a new maze. On a phone, Huge mazes have narrow corridors, so Hard or Expert are often more comfortable.
How do I play the maze game on a phone?
Swipe on the maze in the direction you want to go. Keep your finger down and drag to steer: each stretch of movement is another move, so one drag can turn several corners. You can also tap toward where you want to go, or use the arrow buttons under the maze and hold one down to keep moving.
Can I move one square at a time?
Yes. By default each move glides along the corridor until the next junction, dead end or the exit, which makes big mazes quick to play. Switch Glide off in Settings to move one square per press, or hold Shift with an arrow key to do the opposite of your setting for that move.
Does the wall follower rule work in these mazes?
Yes. Keep one hand on the wall and walk, and you'll always reach the exit, because these mazes have no loops and the start and exit both sit on the outer wall. It isn't the shortest way: in the worst case it visits every corridor of the maze.
What is fog mode?
With Fog on, you can only see the squares within a couple of steps of you, plus the ones you've already visited. The exit stays visible so you know which way to head. It turns a maze into a test of memory and planning, and fog runs keep their own best times.
When does the timer start, and is my best time saved?
The clock starts with your first move, so you can study the maze first, and it pauses if you switch to another tab. Your best time is saved in your browser for each size and style (and separately with fog), along with how many runs were perfect: no wrong turns at all.
Is there a daily maze?
Yes. Choose Daily for today's 16 × 16 maze, which is the same for everyone, so you can compare times with friends. The style changes from day to day. Your first solve each day counts toward your daily streak.
Can I print a maze?
Yes. Open Settings and choose Print maze, or Print with solution for an answer sheet. You get a clean black-and-white copy with gaps at the start and exit, which works well for children's activity sheets. Easy and Medium sizes are best for young children.
Can I send a maze to a friend?
Yes. Share opens your phone's share sheet or copies a link, and the link rebuilds exactly the same maze for whoever opens it, so you can race each other. Shared mazes don't count toward statistics.
How are the mazes generated?
Each maze starts as a grid with every wall standing, and an algorithm knocks walls down until every square is connected, without ever creating a loop. Mathematically, that's a random spanning tree of the grid. A maze is built from a random number called a seed, so the same seed always rebuilds the same maze; that's how daily and shared mazes work.
More games to play
Free, browser-based, and instant — no installs or accounts.