How to play
Tap any square to place the knight. From then on, tap one of the marked squares to jump there. A knight moves in an L shape: two squares in a straight line and then one square to the side. Every square you leave gets a number, so you can see the order of your tour. You win when the knight has stood on every square exactly once.
On a keyboard, move the frame with the arrow keys and press Enter or Space to place or move the knight. Ctrl+Z undoes a move and H asks for a hint.
- Board size runs from 5×5 to the full 8×8 chessboard.
- Closed tour mode adds one more condition: your last square has to be a knight's move from your first one. The start square gets a green ring so you can keep an eye on it.
- Show a solution finishes the tour from where you are, if that is still possible, and plays the remaining moves on the board.
Warnsdorff's rule
In 1823 H. C. von Warnsdorff described a simple rule: always jump to the square that has the fewest onward moves. Squares with few exits, like corners and edges, get used up before they become traps, and the open middle of the board is saved for later when you need room to move.
The rule works remarkably well. On an 8×8 board, following it usually gives a complete tour. It is not perfect, though. When two squares tie, the choice can matter, and on some boards a tie broken the wrong way ends in a dead end. That is why the hint button checks its suggestion before showing it.
Tips for solving by hand
Clear the corners early
A corner square has only two knight moves into it. If you pass both of them without visiting the corner, it can never be reached. Starting in a corner, or visiting each corner as soon as you are next to it, avoids the most common way to get stuck.
Work around the edge
Many people circle the outer two rings of the board first and leave the center for the end. The center squares have up to eight exits, so they stay flexible much longer than the edges.
Watch the colors
Every knight move lands on the other color. On a 5×5 board there are 13 squares of the corner color and 12 of the other, so a full tour must start and end on the corner color. The same is true on 7×7. If you start on the wrong color there, no amount of skill will finish the tour.
A little history
The puzzle is centuries old, and Leonhard Euler studied it in 1759, showing ways to build tours and to join them into closed loops. Since then it has become a classic example in math and computer science of what is now called a Hamiltonian path: a route through a network that visits every point once. The numbers involved are huge. The 8×8 board alone has more than 13 trillion different closed tours.
Open tours exist on every square board from 5×5 upward. Closed tours are rarer. Since the knight changes color on every move, a closed loop needs as many light squares as dark ones, so boards with an odd number of squares, like 5×5 and 7×7, never have one. On 6×6 and 8×8 there are plenty to find.
More chess challenges
The knight's tour is good practice for seeing knight moves quickly, a skill that helps in real games. Put it to work in our Chess Puzzles, where forks by the knight come up often, or play chess against the computer. For another grid puzzle with a mathematical twist, try the Light Switch Puzzle.
Questions
Is a knight's tour always possible?
On every square board from 5×5 up, an open tour exists. On 5×5 and 7×7 it has to start on a square the color of the corners. Closed tours need an even number of squares, so here they exist on 6×6 and 8×8 only.
What is the difference between an open and a closed tour?
An open tour visits every square once and can end anywhere. A closed tour must end a knight's move away from where it started, so the knight could jump straight back and repeat the same loop.
How does the hint work?
It follows Warnsdorff's rule and suggests the square with the fewest onward moves. Before showing it, the game checks that a full tour can still be finished from that square, and tells you if the rule would have led to a dead end.
What counts as a best result?
The fewest undos, and the faster time when undos are equal. Results are kept per board size and tour type. Games where you used a hint or showed the solution are not saved as a best.