Heart Maze Printable — Heart-Shaped Maze With Answer Key

The classic heart curve, evaluated per cell, filled with a Kruskal maze. Even corridors, no directional bias, and the point of the heart is the hardest part to leave.

Heart-shaped maskKruskal's algorithm22 × 22 gridAnswer key

Maze maker

0 cells 0 dead ends 0 step solution 0 moves 0:00

A preset sets the grid size and the algorithm together.

20 × 20 cells

The seed is written into the URL, so a reload — or a shared link — restores this exact maze.

This page’s maze, measured

A fixed seed (410013) on a 22 × 22 grid built with the Kruskal's algorithm. Every number below is computed from this maze at build time, then printed unchanged.

314 cells, 94 dead ends, shortest solution 62 steps
Cells
314
Open passages
313
Dead ends
94
Junctions
80
Shortest solution
62 steps
Mean branching
1.99

Answer key

The same maze with the shortest path drawn through it. The print button in the tool prints this key on its own page.

Answer key: 63 cells on the shortest path

Open the tool above with the same seed and press Print to get a clean worksheet plus this key, or Download SVG for a vector copy.

Printing the heart maze

The heart is an implicit curve — (x² + y² − 1)³ − x²y³ ≤ 0 — evaluated at the centre of every cell. Cells outside the curve are removed, the remainder is checked for connectivity, and Kruskal's algorithm builds the maze. That combination gives a heart with an even texture, which reads better inside a small silhouette than a long backtracker corridor would.

The point at the bottom of the heart is narrow, so at 22 cells wide it collapses to about three cells. The generator handles that by construction: it never leaves an unreachable pocket, and the printed sheet always has exactly one route between the start and the finish.

  1. One per page for a card-sized puzzle, four per page for party favours.
  2. Keep the answer key on: the bottom point of the heart is easy to leave unfinished.
  3. Print on coloured paper and skip the ink — the shape reads clearly in silhouette.
  4. Switch the shape to Star for a second card from the same seed and size.

Why the heart is built with Kruskal

Kruskal's algorithm refuses to bias the tree in any direction, so the corridors fill the two lobes evenly instead of favouring one side the way a depth-first search can. Inside a shape with a strong visual axis, that evenness is what stops the maze looking lopsided.

The mask is checked for connectivity after the curve is evaluated, and the component filter keeps the piece that contains the centre of the grid. That is what guarantees a heart that is slightly too small to close still produces a solvable maze rather than a floating fragment.

Frequently asked questions

Can I print a heart maze for Valentine's Day?

Yes, and you can type a name into the title field first so it prints above the maze. The seed stays in the URL, so the same heart can be reprinted later.

Why does the bottom point of the heart look thin?

Because a heart curve narrows to a cusp. At 22 cells wide the point is about three cells across, which is the minimum needed for a corridor to be printable.

Can I make the heart maze harder?

Raise the size to 32 or 40 and keep Kruskal. The silhouette gets sharper as resolution increases, and the dead-end count rises with it.