Knight's Tour Puzzle
Move the knight so that it lands on every square exactly once. Play on 5 × 5 up to 8 × 8, ask for a hint, or let the page finish the tour from where you are.
What is the knight's tour puzzle?
The knight's tour puzzle is an online knight tour puzzle where you move a knight across a chessboard and visit every square exactly once. You can choose a board from 5 × 5 to 8 × 8, place the knight on any square, and build a tour one jump at a time. The page runs its search in your browser, so you can use it as a knights tour solver or as a practice board for the knight tour problem, one of the oldest chess puzzles. It shows you where the knight can go next, numbers each square as you visit it, and tells you when a tour is complete.

How to use the knight's tour puzzle
- Choose a board size from 5 × 5 to 8 × 8.
- Click any square to place the knight.
- Click one of the highlighted squares to jump there. Squares you have visited show their order number.
- Keep going until you reach a dead end, or until every square is numbered.
- When every square is numbered, the puzzle is solved.
If you run out of moves before the board is full, the page tells you. Use "Undo" to step back one move, "Hint" to get a safe next square, or "Finish the tour for me" to let the page complete the tour from where you are.
The two helper buttons do different jobs. Hint highlights a square from which a complete tour is still possible, so you can check your route before you commit to it. Finish the tour for me fills in the remaining squares in one go. If either one cannot find a way to finish from where you are, the page says so.
The page is built for playing on screen, but it prints like any other page. To draw a tour on paper, use the blank-board sheet maker and mark the order of the squares by hand. Nothing is saved between visits, so print or write down a tour you want to keep.
What is the knight's tour problem?
The knight's tour problem asks whether a knight can start on a square and visit every other square exactly once, moving only as a knight moves. A knight moves two squares in one direction and one square at a right angle, so it jumps over the squares in between. The sequence of moves that does this is called a knight's tour.
The problem is one of the oldest chess puzzles, and Leonhard Euler studied it in the 18th century. Not every start square works on every board, so finding a tour is part of the challenge.
What is the difference between an open and a closed tour?
A tour is closed if the last square is one knight's move away from the first square, so the knight could jump back and start the cycle again. If the last square is not one knight's move from the first, the tour is open.
A knight changes square colour on every move. A 5 × 5 board has an odd number of squares, so it has no closed tour. Open tours do exist on it, but only from the squares of the same colour as the corners.
How do you solve a knight's tour?
The main technique is Warnsdorff's rule, published in 1823: always move to the square from which the knight would have the fewest onward moves. This keeps the knight from leaving awkward squares behind. It finds a tour on the 8 × 8 board very often, though not always.
Apply the rule with a few habits:
- Keep to the edges and corners early. They have the fewest knight moves and are easy to strand.
- Before each jump, count the onward moves from each candidate square and prefer the one with the fewest.
- If you get stuck, go back and try a different choice earlier in the tour.
Is there a solver?
Yes. The page uses a search that tries the squares with the fewest onward moves first, which is Warnsdorff's rule in practice. When it reaches a dead end, it backs up and tries another path. This makes it fast enough to finish a tour on the board you are playing.
If the search cannot find a tour from where you are, it says so. You can then undo your last moves or start again from a different square.
Examples
Questions and answers
Can I start a tour from any square?
On 8 × 8 you can start anywhere, and the page will find a tour from any square. On 5 × 5, only squares of the same colour as the corners work as starting points.
Which squares can the knight move to?
The page highlights the squares the knight can reach from where it stands. Click one of them to jump there. Squares you have already visited keep their order number, so the route so far stays on the board.
What is a dead end?
A dead end is a point where the knight has no unvisited square left to jump to, while empty squares remain. The search backs up when it reaches one and tries another route. On your own board, use "Undo" to step back out of a dead end.
Why does my 5 × 5 tour never show the finish message?
You may have started on a square of the wrong colour. Try another starting square, and remember that 5 × 5 boards have no closed tour.
What happens if I run out of moves?
The page tells you that the board is not full and no moves are left. You can use "Undo" to step back, or restart with a new starting square.
Does the page remember my tour?
No. Nothing is stored or sent anywhere. If you reload the page, the board is empty.
Related chess tools
Updated