The Knight's Tour: History, Rules and How to Solve It on Any Board
A knight's tour is a path that takes a chess knight to every square of a board exactly once, using only legal knight moves. If the knight's last square is one knight's move away from where it started, so it could hop straight back and repeat the loop, the tour is called closed. If not, it's open. On a standard 8x8 chessboard both kinds exist, and there are trillions of them. The fastest way to find one by hand is a 200-year-old trick called Warnsdorff's rule: always jump to the square that has the fewest moves left out of it.
That's the short answer. The rest of this guide walks through how the puzzle works, where it came from, how to solve it with a pencil, which board sizes are possible and which are hopeless, and how mathematicians finally counted the tours. Every tour shown on this page was checked by a short computer program, square by square, before we printed it here. So you can trust the numbers and use them as answer keys.
What is a knight's tour?
The knight is the chess piece shaped like a horse's head. It moves in an "L": two squares in a straight line, then one square to the side. Or, if you like, one square one way and two squares the other. It's the only standard chess piece that jumps, so other pieces never block it.
The knight's tour puzzle asks a simple question. Put a knight on any square. Can you move it around so that it lands on every square of the board once, with no square visited twice and none skipped?
On paper, you usually solve it by writing numbers in the squares. Write 1 where the knight starts, 2 where it lands next, 3 after that, and so on. On an 8x8 board you're done when you write 64. The finished grid is the answer: anyone can check it by following the numbers in order and making sure each step is a real knight move.
It sounds like a chess problem, but you don't need to know how to play chess at all. You only need the one move. That's part of why the puzzle has lasted so long. It's a pure path-finding challenge, a bit like a maze where the walls are invisible and the rule of movement is strange. If you enjoy number-placement puzzles such as the ones in our guide to games like sudoku, the knight's tour scratches a similar itch.
How the knight moves, and why corners are dangerous
Before you try a tour, it helps to see how many moves each square offers. A knight in the middle of the board can jump to 8 different squares. A knight in a corner can only jump to 2. Squares near the edge are somewhere in between.
Here's the number of knight moves available from every square of an empty 8x8 board. We generated this table with a short program that counted the legal moves from each square:
| Rank | a | b | c | d | e | f | g | h |
|---|---|---|---|---|---|---|---|---|
| 8 | 2 | 3 | 4 | 4 | 4 | 4 | 3 | 2 |
| 7 | 3 | 4 | 6 | 6 | 6 | 6 | 4 | 3 |
| 6 | 4 | 6 | 8 | 8 | 8 | 8 | 6 | 4 |
| 5 | 4 | 6 | 8 | 8 | 8 | 8 | 6 | 4 |
| 4 | 4 | 6 | 8 | 8 | 8 | 8 | 6 | 4 |
| 3 | 4 | 6 | 8 | 8 | 8 | 8 | 6 | 4 |
| 2 | 3 | 4 | 6 | 6 | 6 | 6 | 4 | 3 |
| 1 | 2 | 3 | 4 | 4 | 4 | 4 | 3 | 2 |
Look at the pattern. The corners have 2 moves, the squares next to the corners on the edge have 3, and the big middle block of 16 squares has 8 each. That matters a lot. Every time the knight passes through a square, it uses up two of that square's connections: one way in and one way out (except for the first and last squares of the tour, which only need one). A corner has only 2 connections in total. So once the knight uses one of them to visit a neighbor, the corner is down to a single remaining doorway. If you're careless and use that doorway for something else, the corner is cut off forever.
This is the single most important idea for solving a knight's tour by hand: the edges and corners are where tours die. The middle of the board is roomy. You can almost always get back to the middle later. The edges are tight, so you want to deal with them early, before you run out of ways in.
How to name squares
Chess players label the columns (called files) a through h from left to right, and the rows (called ranks) 1 through 8 from bottom to top. So a1 is the bottom-left corner, h1 is the bottom-right, and h8 is the top-right. We'll use that system below. In every grid on this page, rank 8 is at the top, just as on a printed chessboard, and file a is the left column.
Open vs. closed knight's tours
There are two kinds of tour, and puzzle books don't always say which one they want. Here's how they compare:
| Feature | Open tour | Closed tour |
|---|---|---|
| Visits every square once | Yes | Yes |
| Last square is a knight's move from the first | No | Yes |
| Other names | Knight's path | Re-entrant tour, knight's circuit |
| Can start anywhere on the loop | No, the ends are fixed | Yes, any square on the loop can be "square 1" |
| Difficulty by hand | Easier | Harder, because the ending must link back |
| Possible on a 5x5 board | Yes | No |
| Possible on an 8x8 board | Yes | Yes |
| Graph-theory name | Hamiltonian path | Hamiltonian cycle |
A closed tour is really a loop. Once you have one, you can start it on any of its squares, and you can run it in either direction. That's handy: if a friend says "start on e4," a closed tour lets you do it instantly by renumbering. An open tour has two fixed ends, so it only works from one of those two ends.
The last row needs a word of explanation. Mathematicians picture the board as a graph: a set of dots (one per square) with lines connecting any two squares a knight's move apart. A path that visits every dot exactly once is called a Hamiltonian path, and a loop that does so is a Hamiltonian cycle. The name comes from the Irish mathematician William Rowan Hamilton, whose "Icosian game" of the late 1850s asked players to visit every city on a board exactly once and return home, as DeMaio and Mathew note in the Electronic Journal of Combinatorics. The knight's tour is the most famous example of that bigger problem, and it's older than Hamilton by about a thousand years.
A short history of the knight's tour
The puzzle is old. According to the MacTutor History of Mathematics archive at the University of St Andrews, the first known tour is credited to al-Adli ar-Rumi, a ninth-century player of shatranj (the older Middle Eastern form of chess) who worked in Baghdad. His tour survives because it was copied into a manuscript from around 1350.
The puzzle then turns up again and again in Europe. The big mathematical moment came with the Swiss mathematician Leonhard Euler. The Euler Archive at the University of the Pacific lists his paper as number 309 in the standard catalog of his works. Its title translates as "Solution of a curious question which does not seem to have been subjected to any analysis." Euler wrote it in 1758 and it was presented in 1759, though it wasn't printed until 1766, in the Berlin Academy's Mémoires. The archive calls it the first mathematical paper on knight's tours.
Euler didn't just find tours. As the University of Cambridge's Plus magazine explains, he described a method for building them and argued that their number is so large you could never run out. He was right, though it took more than two centuries and modern computers to find out just how right.
Here's the timeline in one place:
| When | Who | What happened |
|---|---|---|
| 9th century | al-Adli ar-Rumi (Baghdad) | Earliest known knight's tour, preserved in a manuscript copied around 1350 |
| 1758 to 1766 | Leonhard Euler | Writes (1758), presents (1759) and finally publishes (1766) the first mathematical study of the tour |
| 1823 | H. C. von Warnsdorff | Publishes the "fewest onward moves" rule for finding tours by hand |
| 1839 and 1840 | de Lavernède, then Roget | Publish a method for highly symmetric closed tours on boards whose side is a multiple of 4 |
| October 1967 | Martin Gardner | Covers knight's tours on rectangular boards in his Scientific American column |
| 1978 | Cull and De Curtins | Prove that tours exist on every rectangular board whose shorter side is at least 5 |
| 1991 | Allen Schwenk | Settles exactly which rectangular boards have a closed tour |
| 1996 | Löbbing and Wegener | Publish a computer count of closed 8x8 tours that turns out to be wrong |
| 1997 | Brendan McKay | Counts 13,267,364,410,532 closed tours on the 8x8 board |
| 2000 | Wegener | Publishes a revised count that agrees with McKay's |
| 2011 | DeMaio and Mathew | Extend Schwenk's result to three-dimensional "boxes" of cubes |
| 2014 | Alexander Chernov | Computes the number of open 8x8 tours |
The 1823, 1839, 1840, 1978 and 2000 entries come from the MacTutor chapter on mathematics and chess. The Gardner, Schwenk and 2011 entries come from DeMaio and Mathew's paper. The counting entries come from Plus magazine and from McKay's technical report at the Australian National University. We'll come back to the counting story later.
How to solve a knight's tour by hand with Warnsdorff's rule
Trying a knight's tour with no plan is frustrating. Most people get to somewhere around the 40s or 50s and then discover the knight is stranded, with a handful of unvisited squares scattered around the edges that it can't reach. Then they start over.
In 1823, H. C. von Warnsdorff published a rule that fixes most of that. As Samuel Marateck of New York University puts it, the next square is always the one with the fewest valid exits. In plain words:
From where the knight stands, look at every square it could jump to next. For each one, count how many unvisited squares the knight could reach from there. Jump to the square with the smallest count.
Why does this work? It's the corner problem from earlier. Squares with few remaining exits are the ones in danger of being cut off. Warnsdorff's rule visits them while they still have a way in, and saves the roomy middle squares for later. It's a greedy rule, meaning it makes the best-looking choice at each step without planning ahead, and greedy rules don't always succeed. But this one succeeds remarkably often.
The method, step by step
- Draw an 8x8 grid (or print a blank chessboard). Write 1 in your starting square.
- List every unvisited square the knight can jump to from its current square.
- For each of those candidate squares, count the unvisited squares a knight could reach from it. Don't count the square the knight is standing on now, since it's already used.
- Move to the candidate with the lowest count. Write the next number there.
- If two or more candidates tie, pick either one. (More on ties below.)
- Repeat steps 2 through 5 until you write 64.
Counting exits sounds slow, but you get fast at it. After a while you'll see at a glance that a square near the edge with most of its neighbors filled in "has to go next."
Worked example: the first six moves from a1
Let's start in the bottom-left corner, a1, and apply the rule. The counts below are exact; our program printed them as it built the tour.
- Move 1, from a1. The knight can go to b3 or c2. From b3 there are 5 unvisited squares to jump to next, and from c2 there are also 5. It's a tie, so we pick b3.
- Move 2, from b3. Options: d2 (5 exits), c1 (3), a5 (3), c5 (7), d4 (7). The lowest is 3, shared by c1 and a5. We pick c1.
- Move 3, from c1. Options: a2 (2 exits), d3 (7), e2 (5). The edge square a2 wins easily.
- Move 4, from a2. Options: b4 (5) and c3 (7). Go to b4.
- Move 5, from b4. Options: d3 (6), c2 (4), a6 (3), c6 (7), d5 (7). Go to a6.
- Move 6, from a6. Options: c5 (6), b8 (2), c7 (5). Go to b8, near the top-left corner.
Notice what the rule is doing: it hugs the edges. It sweeps along the left side and toward the top before it ever touches the center. That's exactly the behavior you want.
Keep going the same way and you get a complete tour. Here's the finished result from that run, with a1 marked 1. It's an open tour: it ends on g6 (square 64), which is not a knight's move from a1.
| Rank | a | b | c | d | e | f | g | h |
|---|---|---|---|---|---|---|---|---|
| 8 | 44 | 7 | 52 | 59 | 46 | 9 | 38 | 63 |
| 7 | 51 | 58 | 45 | 8 | 53 | 62 | 47 | 10 |
| 6 | 6 | 43 | 60 | 55 | 48 | 39 | 64 | 37 |
| 5 | 57 | 50 | 27 | 42 | 61 | 54 | 11 | 40 |
| 4 | 20 | 5 | 56 | 49 | 28 | 41 | 36 | 33 |
| 3 | 23 | 2 | 21 | 26 | 35 | 32 | 15 | 12 |
| 2 | 4 | 19 | 24 | 29 | 14 | 17 | 34 | 31 |
| 1 | 1 | 22 | 3 | 18 | 25 | 30 | 13 | 16 |
To check it, find 1 in the bottom-left corner, then 2 two rows up and one column right (b3), then 3 at c1, and so on. Every step is an L-shaped jump, and every number from 1 to 64 appears once. Our program verified both facts.
What to do about ties
Warnsdorff's rule doesn't say what to do when two squares share the lowest count, and as one analysis from Marateck's paper shows, that's where it can go wrong. He tested the rule on the 8x8 board from all 64 starting squares, using every one of the 40,320 possible fixed orders for breaking ties. That's 64 x 40,320 = 2,580,480 runs. Of those, 78,832 got stuck before finishing. Simple division gives 78,832 / 2,580,480, or about 3 percent. So roughly 97 times out of 100, the plain rule finds a full tour on a standard board.
When you're working by hand, a few tie-breaking habits help:
- Prefer the square closer to an edge or corner. It's more likely to get stranded later.
- Look one step deeper. For each tied square, check what its own best follow-up count would be, and choose the tie whose follow-up is smaller.
- Keep an eraser handy. If you get stuck near the end, back up to the last tie and try the other choice. You rarely need to go back far.
The rule also has limits on bigger boards. The MacTutor chapter reports that it can fail on large boards, roughly 76 squares on a side and up, and that the tours it produces aren't re-entrant (closed). For any board you'd draw by hand, though, it's the best tool you've got.
A verified closed knight's tour on the 8x8 board
Warnsdorff's rule gives you a tour, but usually an open one. Getting a closed tour takes a little more luck or care, because the 64th square has to land a knight's move from square 1.
The easiest trick by hand is to run Warnsdorff's rule but "protect" the starting square's neighbors: don't fill every square next to your start until the very end, so the knight has a way back. A computer can do the same thing by running the rule many times with random tie-breaks and keeping the first run that closes up. That's how we found the tour below. It took 48 tries.
| Rank | a | b | c | d | e | f | g | h |
|---|---|---|---|---|---|---|---|---|
| 8 | 32 | 19 | 34 | 5 | 30 | 9 | 38 | 7 |
| 7 | 35 | 4 | 31 | 20 | 37 | 6 | 29 | 10 |
| 6 | 18 | 33 | 36 | 57 | 62 | 41 | 8 | 39 |
| 5 | 3 | 56 | 21 | 60 | 53 | 58 | 11 | 28 |
| 4 | 22 | 17 | 54 | 63 | 42 | 61 | 40 | 49 |
| 3 | 55 | 2 | 43 | 52 | 59 | 48 | 27 | 12 |
| 2 | 16 | 23 | 64 | 45 | 14 | 25 | 50 | 47 |
| 1 | 1 | 44 | 15 | 24 | 51 | 46 | 13 | 26 |
Square 64 sits on c2. From c2, a knight can jump to a1, where square 1 is. So the loop closes. Because it's a loop, you can renumber it from any square you like. Want a tour that starts on e4? Find the number on e4, call it 1, and count forward from there, wrapping from 64 back to the old 1. Every step is still a legal knight move.
This makes a nice printable challenge for a classroom or a puzzle night. Give people a blank board with a few numbers filled in from this tour, say 1, 20, 40 and 64, and ask them to fill in the rest. It's similar to how a sudoku gives you starting clues. Our page on puzzles for teachers has more ideas for running puzzle activities with a group.
Which boards have a knight's tour? Schwenk's theorem
Not every board has a tour. Try a 3x3 board and you'll find the knight can never reach the center square at all, because every knight move from the center leaves the board. Try a 4x4 board and you'll get stuck no matter what.
For closed tours on rectangular boards, the full answer came in 1991 from Allen Schwenk. As DeMaio and Mathew state his theorem, a board with m rows and n columns (where m is the smaller number) has a closed knight's tour unless at least one of these is true:
- m and n are both odd;
- m is 1, 2 or 4;
- m is 3 and n is 4, 6 or 8.
Every other rectangle has a closed tour. That's a surprisingly clean answer to a question people had poked at for centuries.
Open tours are easier to come by. The MacTutor chapter credits Cull and De Curtins (1978) with proving that tours exist on rectangular boards whose smallest side is at least five, and notes that square boards smaller than 5x5 have none (apart from the trivial 1x1 board, where the knight is "done" before it moves).
We checked a set of small boards with an exhaustive computer search, which tries every possible path, so a "no" below really means none exist. The results match the theorems above:
| Board | Open tour? | Closed tour? | Why |
|---|---|---|---|
| 3x3 | No | No | The center square can't be reached |
| 3x4 | Yes | No | Schwenk rule 3 (m is 3, n is 4) |
| 3x6 | Not tested | No | Schwenk rule 3 |
| 3x8 | Not tested | No | Schwenk rule 3 |
| 3x10 | Yes | Yes | Smallest 3-row board with a closed tour |
| 4x4 | No | No | Too cramped; every attempt strands a square |
| 4x5 | Not tested | No | Schwenk rule 2 (m is 4) |
| 4x6 | Not tested | No | Schwenk rule 2 |
| 5x5 | Yes | No | Schwenk rule 1 (both sides odd) |
| 5x6 | Yes | Yes | None of the three rules apply |
| 6x6 | Yes | Yes | None of the three rules apply |
| 8x8 | Yes | Yes | The classic board |
"Yes" for a closed tour also means "yes" for an open one, since you can just leave off the final hop back. The "Not tested" entries are boards where we only checked closed tours.
Why some boards can never work: the color argument
You don't need a computer to see why rule 1 is true. It comes down to the checkerboard colors.
A knight always moves from a light square to a dark square, or from dark to light. Check it on a real board: two squares one way and one square the other always adds up to an odd number of steps, and an odd number of steps always flips the color. So a knight's tour alternates colors perfectly: light, dark, light, dark, all the way through.
Now think about a closed tour. It's a loop that alternates colors, so it must contain exactly as many light squares as dark ones. On a board where both sides are odd, like 5x5 or 7x7, the total number of squares is odd, so the two colors can't be equal. A 5x5 board has 25 squares: 13 of the corner color and 12 of the other. No closed tour can exist. That's rule 1.
The same idea tells you where an open tour on a 5x5 board can start. A 25-square tour alternates colors, so squares 1, 3, 5 and so on up to 25 are all the same color. That's 13 squares. So the tour must start (and end) on the color that has 13 squares, which is the color of the corners. If you start on any of the other 12 squares, you're doomed before you begin.
We confirmed this by counting every open tour on the 5x5 board, from every starting square:
- Each corner: 304 tours.
- The center: 64 tours.
- Each of the other 8 squares of the corner color: 56 tours.
- Each of the 12 squares of the other color: 0 tours.
Add them up: 4 x 304 + 64 + 8 x 56 = 1,216 + 64 + 448 = 1,728 tours, counting a tour and its reverse separately. And not one of them starts on the "wrong" color.
Rule 3 and the 4-row case in rule 2 need cleverer arguments, but rule 1 is something you can explain to a curious ten-year-old with a checkerboard. It's a lovely example of how a little logic can prove something is impossible without trying every case, which is a theme you'll also find in our article on the mathematics of sudoku.
Start small: knight's tours to try yourself
An 8x8 board is a big first attempt. If you're new to the puzzle, or teaching it, start with a smaller board where you can see the whole thing at once.
The 3x4 board
This is the smallest board with a full tour (besides 1x1). Our search found tours only when the knight starts on one of the two short ends, the left or right column. Here's one, starting at a1:
| Rank | a | b | c | d |
|---|---|---|---|---|
| 3 | 3 | 6 | 9 | 12 |
| 2 | 8 | 11 | 2 | 5 |
| 1 | 1 | 4 | 7 | 10 |
Give a beginner this board with only 1 and 12 filled in. It takes a few minutes, and it teaches the key lesson: you have to visit the hard-to-reach squares before you lose access to them.
The 5x5 board
The 5x5 board is the smallest square board with a tour. Remember the color rule: start on a corner or another square of the corner color, or you'll never finish. Here's an open tour starting from the bottom-left corner:
| Rank | a | b | c | d | e |
|---|---|---|---|---|---|
| 5 | 25 | 6 | 15 | 12 | 23 |
| 4 | 16 | 11 | 24 | 7 | 14 |
| 3 | 5 | 2 | 13 | 22 | 19 |
| 2 | 10 | 17 | 20 | 3 | 8 |
| 1 | 1 | 4 | 9 | 18 | 21 |
Try covering this table with a sheet of paper and solving it yourself from a1. Then try starting from the center, which has fewer tours (64 instead of 304) and feels noticeably harder.
The 6x6 board
The 6x6 board is the smallest square board with a closed tour. This is a good stepping stone before the full 8x8. Here's a verified closed tour; square 36 is on e1, a knight's move from square 1 on d3:
| Rank | a | b | c | d | e | f |
|---|---|---|---|---|---|---|
| 6 | 11 | 6 | 19 | 26 | 17 | 8 |
| 5 | 32 | 27 | 10 | 7 | 20 | 25 |
| 4 | 5 | 12 | 31 | 18 | 9 | 16 |
| 3 | 30 | 33 | 28 | 1 | 24 | 21 |
| 2 | 13 | 4 | 35 | 22 | 15 | 2 |
| 1 | 34 | 29 | 14 | 3 | 36 | 23 |
A practice ladder
- 3x4, open tour, starting in a corner.
- 5x5, open tour, starting in a corner.
- 5x5, open tour, starting in the center.
- 6x6, closed tour.
- 8x8, open tour, using Warnsdorff's rule.
- 8x8, closed tour.
- 8x8, closed tour with extra conditions, like "visit the four corners in order" or "start and end next to the center."
If you like this kind of slow, careful path-finding, you might also enjoy harder mazes. Our collection of mazes for adults has the same "don't trap yourself" feel, with walls instead of knight moves.
How many knight's tours are there?
Euler guessed the number was enormous. It took computers to pin it down, and even then the first attempt was wrong.
In 1996, Martin Löbbing and Ingo Wegener published a count of closed tours on the 8x8 board: 33,439,123,484,294. According to Plus magazine, others quickly spotted a problem. Because of the board's symmetry, the true number has to be divisible by 4, and that one isn't. (A quick check: a number is divisible by 4 when its last two digits are, and 94 isn't.)
In 1997, Brendan McKay of the Australian National University redid the count. His technical report gives the total number of undirected closed tours as 13,267,364,410,532. "Undirected" means a loop and the same loop run backward count as one tour. McKay also found 1,658,420,855,433 essentially different tours if you treat rotations and reflections of the board as the same. MacTutor notes that Wegener's revised count in 2000 agreed with McKay's. And yes, 13,267,364,410,532 ends in 32, which is divisible by 4.
Open tours are far more numerous and much harder to count. Plus magazine reports that in 2014 Alexander Chernov computed 19,591,828,170,979,904 tours that can't be closed into a loop. Researchers Héctor Cancela and Ernesto Mordecki had earlier estimated the number using random sampling, and in a later paper they wrote that Chernov's figure falls inside their predicted range. They said they believe it's correct but would like an independent check. So that one is best described as "computed, and consistent with estimates," not yet "confirmed twice."
| Board | What's counted | Number | Source |
|---|---|---|---|
| 5x5 | Open tours, all starting squares, a tour and its reverse counted separately | 1,728 | Our own exhaustive search |
| 8x8 | Closed tours, a loop and its reverse counted once | 13,267,364,410,532 | McKay (1997) |
| 8x8 | Closed tours, also treating rotations and reflections as the same | 1,658,420,855,433 | McKay (1997) |
| 8x8 | Tours that can't be closed into a loop | 19,591,828,170,979,904 | Chernov (2014), reported by Plus |
To put the closed-tour number in perspective: if you could check one tour every second, without a break, it would take you more than 400,000 years to see them all. (There are about 31.6 million seconds in a year, and 13.27 trillion divided by 31.6 million is roughly 420,000.)
How computers find knight's tours
If you like code, the knight's tour is a classic first project in backtracking. Backtracking means: make a move, keep going, and if you hit a dead end, undo the last move and try the next option. It's how you'd search a maze with a ball of string.
Plain backtracking on an 8x8 board is painfully slow, because there are so many dead ends. The fix is the same idea a human uses. Try the candidate moves in Warnsdorff order (fewest exits first), and most of the time the very first path works with little or no backing up. When we built the tours on this page, a program that combined backtracking with Warnsdorff ordering found 6x6, 5x6 and 3x10 closed tours in well under a second each.
We hit one trap worth sharing. When we first asked for closed tours starting in a corner, the search seemed to run forever. The reason: Warnsdorff's rule loves low-exit squares, so it greedily used up both of the corner's neighbors early, leaving no way back to the start. Adding one check, "always keep at least one free square next to the start," fixed it at once. It's the same lesson as the corners on a paper board: protect the squares you'll need at the end.
Counting every tour, as McKay did, is a far harder job than finding one. You can't just list them; there are too many. Counting methods split the board into pieces, count how partial paths in each piece can connect, and combine the results.
Common mistakes when solving a knight's tour
- Heading for the middle first. It feels natural because the middle has the most moves. That's exactly why you should save it.
- Starting a 5x5 on the wrong color. On any board with an odd number of squares, an open tour must start on the color that has more squares. Starting elsewhere guarantees failure.
- Miscounting exits. When you count a candidate's exits, don't include squares already numbered, and don't include the square the knight is on now.
- Forgetting the endgame of a closed tour. If you want a loop, keep at least one neighbor of square 1 empty until the very last move.
- Erasing everything when stuck. Back up only to the last tie or close call. Usually the mistake was a few moves ago, not at the beginning.
- Trying impossible boards. No closed tour exists on 5x5, 7x7, any 4-row board, or 3x4, 3x6 and 3x8. Check Schwenk's three rules before you spend an evening on one.
Variations and related puzzles
Once the standard tour feels easy, there's a lot more to explore:
- Magic knight's tours. Tours where the numbers in each row and column add up to the same total, like a magic square.
- Symmetric tours. Tours that look the same after rotating the board. The 1839 and 1840 methods credited to de Lavernède and Roget in the MacTutor chapter produce highly symmetric closed tours on boards whose side is a multiple of 4.
- Odd-shaped boards. Boards with holes, crosses, or diamond shapes. Draw one, then check the color counts before you start.
- 3D boards. DeMaio and Mathew (2011) worked out exactly which rectangular boxes of cubes have a closed tour, where the knight moves two cells along one direction and one along another.
- Other leapers. Pieces that jump in different patterns, such as three squares one way and one the other. The same questions apply: which boards allow a full tour?
- Clue-based tours. Puzzle books sometimes print a board with a few numbers given and ask you to fill in the rest. It's a knight's tour crossed with a logic puzzle, and it's a great format for printing.
Puzzles like these give your planning and spatial skills a workout. If you're curious about what the research does and doesn't say about that, see our article on whether puzzles are good for the brain, and for gentler options for older solvers, our page on puzzles for senior brain games.
Make your own puzzle pages
A knight's tour pairs nicely with other paper puzzles on a printed activity sheet. Copy one of the verified grids above as your answer key, blank out most of the numbers, and add a word search or crossword on the same theme (chess vocabulary works well: knight, rook, bishop, castle, checkmate, gambit).
For the word puzzles, our free puzzle maker lets you type your own words or pick a theme, choose a puzzle type, and print it with an answer key. Put the two side by side and you've got a chess-themed puzzle page ready for a club, a classroom or a quiet evening.
Six Common Slip-Ups and Better Moves
This table pairs each common mistake in a knight's tour with a better habit.
| Slip-up | Why it causes trouble | Better move |
|---|---|---|
| Heading for the middle first | It feels natural because the middle has the most moves, which is exactly why it should be saved | Save the middle squares for later |
| Starting a 5x5 on the wrong color | On a board with an odd number of squares, an open tour must start on the color that has more squares | Start on a corner-color square |
| Miscounting exits | Squares already numbered, or the square the knight is on, get counted by mistake | Count only free squares a candidate can reach |
| Forgetting the endgame of a closed tour | The tour can't link back to the start | Keep at least one neighbor of square 1 empty until the very last move |
| Erasing everything when stuck | Usually the mistake was a few moves ago, not at the beginning | Back up only to the last tie or close call |
| Trying impossible boards | No closed tour exists on 5x5, 7x7, any 4-row board, or 3x4, 3x6 and 3x8 | Check Schwenk's three rules before you start |
Frequently Asked Questions
What is a knight's tour in simple terms?
A knight's tour is a sequence of chess knight moves that lands on every square of a board exactly once. You usually record it by writing 1 on the starting square, 2 on the next square, and so on until every square has a number. On a standard 8x8 board, the last number is 64. If the final square is one knight's move away from the first, the tour is closed and forms a loop. Otherwise it's an open tour. You don't need to know how to play chess to try one, only how the knight moves.
Is a knight's tour always possible on an 8x8 board?
Yes. The standard 8x8 board has both open and closed tours, and a huge number of each. Brendan McKay's 1997 count found 13,267,364,410,532 closed tours, counting a loop and its reverse as one. An open tour can start from any of the 64 squares. What isn't guaranteed is that a particular attempt will work. If you move without a plan, you'll often strand a few edge squares. Using Warnsdorff's rule, which always moves to the square with the fewest onward exits, makes success very likely.
What is Warnsdorff's rule?
Warnsdorff's rule is a method for finding a knight's tour, published by H. C. von Warnsdorff in 1823. At each step, look at every square the knight could jump to next and count how many unvisited squares it could reach from each one. Move to the square with the smallest count. The idea is to visit hard-to-reach squares, mostly on the edges and corners, before they get cut off. It isn't perfect. One study of the 8x8 board found that about 3 percent of runs got stuck, depending on how ties were broken.
What is the difference between an open and a closed knight's tour?
Both kinds visit every square once. In a closed tour, also called a re-entrant tour, the last square is a knight's move away from the first, so the knight could hop back to the start and repeat the whole loop. In an open tour, the last square isn't connected to the first. Closed tours are harder to find by hand because you have to plan the ending. But they're more flexible, because you can start a closed tour on any square of the loop and still have a valid tour.
Why is there no closed knight's tour on a 5x5 board?
A knight always moves to a square of the opposite color. That means a closed tour, which is a loop, must use exactly as many light squares as dark squares. A 5x5 board has 25 squares, 13 of one color and 12 of the other, so equal numbers are impossible. The same reasoning rules out closed tours on every board where both sides are odd, like 7x7 or 5x7. Open tours do exist on the 5x5 board, but they have to start and end on the color that has 13 squares, which is the color of the corners.
What is the smallest board with a knight's tour?
Ignoring the trivial one-square board, the smallest rectangle with a full tour is 3x4, with 12 squares. It only has open tours, and they have to start on one of the two short ends. The smallest square board with a tour is 5x5, again only open. The smallest square board with a closed tour is 6x6. For boards with three rows, the first one with a closed tour is 3x10, because Allen Schwenk's 1991 theorem rules out closed tours on 3x4, 3x6 and 3x8, and every odd length.
Who invented the knight's tour?
No single inventor is known. The earliest surviving tour is credited to al-Adli ar-Rumi, a ninth-century player of shatranj, an older form of chess, who worked in Baghdad. His tour was preserved in a manuscript copied around 1350. Leonhard Euler wrote the first mathematical paper on the problem in 1758, presented it in 1759, and saw it printed in 1766. Later milestones include Warnsdorff's rule in 1823 and Allen Schwenk's 1991 theorem on which rectangular boards have closed tours.
How many knight's tours are there on a chessboard?
For closed tours on the 8x8 board, Brendan McKay counted 13,267,364,410,532 in 1997, treating a loop and the same loop reversed as one tour. If you also treat rotations and reflections of the board as the same, there are 1,658,420,855,433. An earlier 1996 count was wrong; others noticed it wasn't divisible by 4, as the true answer must be. Open tours are far more numerous. Alexander Chernov computed 19,591,828,170,979,904 in 2014, a figure that matches earlier statistical estimates but hasn't been independently recomputed.
Is the knight's tour good for kids or beginners?
It can be, as long as you start small. A full 8x8 board is a big first attempt, and getting stuck at square 50 is discouraging. Begin with a 3x4 board, then a 5x5 starting from a corner, then a 6x6 closed tour, and only then the full board. Teach the key habit early: visit edge and corner squares while they still have a way in. Printing a board with a few numbers already filled in, like a sudoku with starting clues, makes the puzzle friendlier and gives solvers a way to check their progress.
Sources
We checked every source below while writing this guide. Last reviewed October 30, 2026, by Joan Ramos.
- Solution d'une question curieuse que ne paroit soumise à aucune analyse (E309) (Euler Archive, University of the Pacific)
- Mathematics and Chess, Chapter 3 (MacTutor History of Mathematics, University of St Andrews)
- Knight's tour (from the series Five of Euler's best) (Plus Magazine, University of Cambridge)
- Knight's tours of an 8 x 8 chessboard (Brendan D. McKay, 1997) (Australian National University Open Research)
- Which Chessboards have a Closed Knight's Tour within the Rectangular Prism? (DeMaio and Mathew, 2011) (The Electronic Journal of Combinatorics)
- How good is the Warnsdorff's knight's tour heuristic? (Samuel L. Marateck) (arXiv, New York University)
- On the number of open knight's tours (Cancela and Mordecki) (arXiv, Universidad de la República)




