The knight's tour: the method and the solution
By Arnaud, creator of procstd. Updated November 22, 2026.
Take the chess knight over every square, once each: the puzzle fascinated Euler, and it looks impossible as long as you move at random. Yet one very simple rule, found in 1823 by Warnsdorff, is almost always enough. Here it is, with a step-by-step example and two complete tours, on 5 × 5 and on the 8 × 8 chessboard.
Try it as you read: play Knight's Tour, free and ad-free.
The rules
The knight jumps in an "L": two squares in one direction, then one to the side. From its starting square, it must visit every square of the board, once each. It does not need to come back to the start: this is an "open" tour.
In the Knight's Tour game, each board is drawn from a real tour: it always has a solution. A button takes back one jump, and the leaderboard counts time.
Warnsdorff's rule
At each jump, look at the squares the knight can reach. For each one, count the jumps it would then have, to squares still free. Go to the one with the fewest.
The idea: hard-to-reach squares, the corners and edges, have only two or three neighbours. Leave them for later and you end up cutting them off. Warnsdorff takes them as soon as they are in reach, while there is still a way out. The knight thus runs along the edges first, and finishes in the centre, where choices stay plentiful.
After 4 jumps, the knight has five possible squares; the coloured number says how many jumps it would then have. The corner has only one: go there now, or it would soon be cut off.
A complete tour on 5 × 5
Following the rule from the top-left corner, you fill all 25 squares without ever getting stuck. Notice how the path turns along the edges before heading into the centre.
On 5 × 5, there are 13 squares of one colour and 12 of the other, as on a chequerboard. The knight changes colour at every jump: a 25-square tour therefore starts and ends on the corners' colour. From a square of the other colour, no tour exists. The game never gives you such a start.
Warnsdorff's tour from the corner: the squares are numbered in the order of the jumps, from 1 to 25.
When two squares are tied
The rule says nothing when two squares have the same count. Most of the time, either one works. To give yourself every chance, take the one nearer an edge, or look one move further: which one then leaves a square with a single jump?
If you get stuck before the end, go back a few jumps, to the last tied choice, and take the other square.
The solution on the 8 × 8 chessboard
On the chessboard, the rule also works from the corner, from the first to the 64th jump. Here it is in full: start at 1 and follow the numbers.
Euler studied the problem in 1759, and we now know there are thousands of billions of different tours on 8 × 8. No need to learn them: with the rule, you can find one from any start.
A complete knight's tour on 8 × 8, found with Warnsdorff's rule from the top-left corner.
The holes at the Easy level
At the Easy level, a few squares are holes: the knight cannot go there. The rule stays the same: count only the jumps to free squares that are not holes. A square next to a hole has fewer exits, so it comes earlier.
The game's levels
Easy: 5 × 5, with 5 holes. Hard, the leaderboard level: 6 × 6. Expert: 7 × 7. Hardcore: the 8 × 8 chessboard, with no hints.
Your turn
The rules, the levels and the frequently asked questions are on the Knight's Tour page. Each level has its own leaderboard.
Play Knight's TourOther guides
- How to solve a sudoku: the techniques that work
- Minesweeper: the patterns to know
- How to win at Solitaire: the strategy
- Wordle-style game in French: how to find the word
- 2048: the strategy to win
- How to win at FreeCell
- Nonograms and picross: the method to solve them
- Takuzu (binary puzzle): the techniques to solve it
- How to win at Spider Solitaire
- Killer sudoku: cage combinations and the rule of 45
- Kakuro: sum combinations and the method
- How to solve a Hitori
- Einstein's Riddle: the grid method
- Mahjong solitaire: which tiles to remove first
- How to solve a Slitherlink
- Masyu: the basic techniques
- Traffic Jam: getting the red car out
- Sokoban: the mistakes to avoid
- The 11 nets of a cube
- The Tower of Hanoi: solution and method
- How to solve a sliding puzzle
- Calcudoku: how to solve a grid
- The fake coin puzzle: the method and the 12 coins solution
- How to win at Reversi: the three rules of strategy
- How to win at Four in a Row: the four rules
- How to solve a Skyscrapers puzzle: reading the clues
- How to solve a Tents puzzle: the method
- Yatzy strategy: which dice to keep and where to score
- Solo Battleships puzzle: the method to find the fleet
- How to solve a Crowns puzzle: the method
- Secret Code: the strategy to crack it in 4 or 5 guesses
- How to solve a Bridges (Hashi) puzzle: the method
- How to solve a Light Up (Akari) puzzle: the method
- How to solve an Islands (Nurikabe) puzzle: the method
- How to solve a Suguru: the method
- How to solve a Mosaic puzzle: the method
- How to solve a Rectangles (Shikaku) puzzle: the method
- How to solve a Dominoes (Dominosa) puzzle: the method
- How to solve a Thermometers puzzle: the method
- How to solve an Inequalities (Futoshiki) puzzle: the method
- How to solve an Aquarium puzzle: the method
- How to win at Oware: the four reflexes