🏃 Maze Escape

Arrow keys / WASD / swipe - reach the exit

Arrow Keys or WASD to moveSwipe in the direction you want to moveD-Pad to move
0:00
🏆 Best: ---

How to Play Maze Escape

Maze Escape is a classic puzzle game that challenges your spatial awareness and pathfinding skills. Each game presents a freshly generated maze using a recursive backtracking algorithm, ensuring no two mazes are ever the same. Your goal is simple: navigate from the start cell in the top-left corner to the exit in the bottom-right corner as quickly as possible. The game tracks your time and stores your personal best for each grid size, so you can compete against yourself and steadily improve.

How to Play

Use the arrow keys or WASD to move your character through the maze. On touch devices, swipe in the direction you want to go. You can only move through open passages - walls block your path. The timer starts the moment you make your first move and stops when you reach the exit. Choose from three grid sizes: Small (15×15 cells), Medium (25×25), or Large (35×35). Larger mazes offer more complex paths and longer solve times.

Toggle the fog of war to add extra challenge: when enabled, you only see cells near your current position, forcing you to rely on memory and exploration. The path trail shows every cell you have visited in a subtle highlight, helping you avoid retracing your steps and find more efficient routes.

Maze Generation: Recursive Backtracking

The mazes are generated using recursive backtracking, also known as the depth-first search maze algorithm. The algorithm starts with a grid where every cell is surrounded by walls. It picks a starting cell, then randomly chooses an unvisited neighbor, removes the wall between them, and recursively continues from that neighbor. When a cell has no unvisited neighbors, the algorithm backtracks to the previous cell and tries other directions. This process creates a perfect maze - one with exactly one path between any two cells - with long, winding corridors and no isolated loops. The algorithm uses crypto.getRandomValues for cryptographically secure randomness, ensuring fair and unpredictable maze layouts.

Strategy & Tips

Frequently Asked Questions

Is every maze solvable?

Yes. Recursive backtracking produces perfect mazes with exactly one path between any two cells. There is always a route from start to exit.

How are personal best times stored?

Your best time for each grid size (Small, Medium, Large) is saved in your browser's localStorage. It persists between sessions until you clear site data.

What does fog of war do?

When fog of war is on, only cells within a short distance of your current position are visible. The rest of the maze is hidden until you explore it. This adds a memory and exploration challenge.

Can I play on mobile?

Yes. Swipe in any direction to move. The canvas scales to fit your screen, and touch controls are fully supported.

Play Maze Escape free right here in your browser - no downloads, no accounts. Pick a grid size, enable fog of war if you dare, and race to the exit.

Looking for more? Check out our guide: 10 Best Free Puzzle Games.

Controls

Desktop: Arrow Keys or WASD to move

Mobile: Swipe in the direction you want to move

Gamepad: D-Pad to move