Knight Distance Trainer

How many moves does a knight need to get from one square to another? Plan the shortest route, then check it against the true minimum.

Press Start for ten pairs, or tap any square to see how far the knight is from everywhere else.

Use the arrow keys to move between squares, Home and End for the ends of a rank, and Enter or Space to move the knight to the focused square. Backspace undoes the last move. Between rounds, Enter on a square shows its distance map.

Options
Play from

A pair scores when the knight arrives in the fewest moves possible. Your best round is saved in this browser only.

How far is a knight from any square?

The distance map counts the fewest knight moves from one square to every other. On an empty 8x8 board no square is more than six moves away, and only a corner and the corner opposite it are that far apart: a1 to h8 takes six.

Every knight move lands on the other colour. So a square of the same colour as the start always takes an even number of moves, and a square of the other colour an odd number. That alone rules out half the answers before you start counting.

Some short-looking trips are slow. The square next door, straight up or across, takes three moves. A square two steps along the diagonal, such as d4 to f6, takes four. The square one step diagonally away takes two from the middle of the board but four from a corner, because a knight on a1 has only two squares to go to.

Planning short routes is the skill behind a good Knight's Tour, and Warnsdorff's rule explains why the edges and corners matter most. When you are ready, try a full tour.