Guide
What makes a maze hard?
The obvious lever is size, and it is the weakest one available. A big maze takes longer; it does not take more thought. What resists a solver is the structure of the wrong turns.
Bigger is longer, not harder
Doubling a grid from 20×20 to 40×40 quadruples the cells and roughly quadruples the time, but the reasoning at each junction is identical. A child who can solve the small one can solve the large one; they will simply be at it four times as long, and somewhere around the third minute the activity stops being a puzzle and becomes an endurance test.
This matters when choosing for a class. If the goal is ten minutes of quiet, size is exactly the right lever and you should use it. If the goal is a puzzle that rewards thinking, size is the wrong dial and the ones below are the right ones.
Dead ends, and the tactic every solver discovers
What actually costs a solver time is being tempted down passages that go nowhere. A maze with few, short dead ends reads as a wide corridor with occasional stubs — you can almost see the route. A maze with many long dead ends, each branching several times before terminating, forces genuine commitment: you cannot tell a promising passage from a doomed one without following it.
Every solver eventually finds the same counter-tactic. Work backwards from the exit, or pencil a cross at each dead end so you never re-enter it, and the maze collapses — you are no longer exploring, you are eliminating. On a standard maze this tactic always works, and it works because of a structural property most people never think about: there are no loops.
Perfect mazes, and what "one route" actually means
A maze whose passages contain no loops is called perfect. In graph terms the passages form a spanning tree over the cells, and that single property has a strong consequence: between any two cells there is exactly one route that never doubles back. Not one shortest route — one route, full stop. Almost every maze printed in a puzzle book is perfect, which is why the cross-off-the-dead-ends tactic is reliable.
It is also what makes an answer key meaningful. If exactly one route exists, the key is not a suggestion or one option among several; it is the answer, and a solver who found a different path has made a mistake rather than found an alternative. The maze generator here is tested on exactly this property — its smoke test reconstructs the carved passages from the rendered walls and checks the result really is a spanning tree, because "exactly one solution" is a claim worth verifying rather than asserting.
Braiding: the lever that actually raises difficulty
Adding loops is called braiding, and it is done by taking dead ends and opening a second wall so they connect onward instead of terminating. Braid a few and the maze keeps its character while punishing the pencil-crossing tactic occasionally. Braid most of them and the tactic stops working altogether: there are no dead ends left to cross off, every passage leads somewhere, and the solver has to hold a route in mind rather than eliminate wrong ones.
This is the real difficulty dial, and it costs something specific that is worth understanding before you turn it. Once loops exist the maze is no longer a spanning tree, so there is no longer exactly one route — there are several, and an answer key can only honestly show a shortest one. That is a real trade and the generator states it in both directions: the option is labelled by what it does to the routes, and the printed stamp on the sheet says "shortest route" instead of "the only route" whenever braiding is on. A key that kept claiming uniqueness on a looped maze would be wrong on the page.
Printing it so it can be solved
Cell size is the constraint people get wrong. A 40×40 maze on US Letter leaves each cell about 4.5 mm across, which is narrower than the line a ballpoint draws through it — the route becomes unreadable as it is being traced, and a child following it with a finger cannot tell which side of a wall they are on. Around 6 mm is the practical floor for pencil work and 8 mm is comfortable, which puts roughly 25 columns across a portrait Letter page inside the margins.
Print the answer key on its own sheet rather than the reverse of the puzzle; ordinary copier paper shows the solution through from behind, which is a disappointing way to end a maze. And if you are printing a set for a class, vary the seed rather than the size — different mazes at one size stay comparable to each other, which matters if anyone is racing.
The honest limits
Difficulty is not a number here any more than it is in sudoku. Dead-end density, braid share, and grid size interact, and a heavily braided small maze can beat a large perfect one for a solver who has learned the elimination tactic — and lose to it badly for one who has not. The only reliable test is watching somebody solve it.
And no maze printed on paper resists a solver willing to work backwards from the exit. That is not a flaw to be engineered away; it is a legitimate solving strategy, and the mazes that stay interesting under it are the braided ones, because working backwards through loops is no easier than working forwards.