KOJP

Knight's Tour Online Game

Move a chess knight so it lands on every square exactly once. From 5×5 to the full 8×8 chessboard, its path becomes a golden line that draws a picture

5×5 · 6×6 · 7×7 · 8×8 · Daily tour

The knight only jumps in an L: two squares one way and one square to the side. Squares you can reach glow with a green ring, and every visited square keeps its move number. Visit every square to finish, and if the last square is a knight's jump from the first, it is a closed tour. Your game in progress and best times are saved in this browser.

Controls

Tap a square: pick the start, then jump
Drag the knight onto a square: jump
Tap a visited square twice: rewind to it
Hint: shows the next square that still leads to a full tour
Arrows and Enter jump · Z undo · X undo five · H hint · R random start

What is the knight's tour puzzle?

The knight's tour is a puzzle where a single chess knight must land on every square of the board exactly once. It is one of the oldest chess puzzles and a classic example in mathematics.

The knight is the only chess piece that jumps over others. Each move goes two squares horizontally or vertically and then one square to the side, landing in an L shape. In this game you choose a starting square and then tap the squares that glow with a green ring. Each square you leave keeps a small brass button with its move number, and a golden line links the squares in order. When every square is visited, the crossing lines form a star or flower pattern.

What are the exact rules?

There are only two rules. Move only like a knight, and never land on the same square twice. The tour is complete when you have visited as many squares as the board has.

BoardSquaresPossible startsClosed tours
5×52513 squares the colour of the cornersNone
6×636Every squareYes
7×74925 squares the colour of the cornersNone
8×864Every squareYes

A knight always alternates between light and dark squares. On the odd 5×5 and 7×7 boards one colour has one extra square, so a tour must start on that colour, the colour of the four corners. The game only marks squares where a tour is possible, and our solver confirmed that a full tour exists from all 13 such squares on 5×5 and all 25 on 7×7.

What is Warnsdorff's rule?

Warnsdorff's rule says: of all the squares you can jump to, go to the one that has the fewest onward moves. H. C. von Warnsdorff published it in Germany in 1823.

Squares with few exits are the ones that get stranded if you leave them for later, corners and edges above all. Dealing with them first and saving the roomy centre for the end greatly cuts the chance of running into a dead end. For example, if you can reach three squares that would leave 2, 5 and 3 onward moves, you pick the one with 2. Following this rule alone completes most 8×8 tours on the first try.

The hint in this game tries Warnsdorff's order first and backtracks through other branches when it gets stuck, so it only suggests a square that really leads to a full tour. If your path can no longer be finished, it works out how many moves back you need to go, makes that square sparkle blue, and one tap on it rewinds the board to that point.

What is a closed tour?

A closed tour is a complete tour whose last square is one knight's jump away from the first, so the path joins up into a loop. It is also called a re-entrant tour.

When you finish a closed tour, a glowing dashed line links the last square back to the first, a ring of stars circles the starting square, and the result card counts your closed tours. Closed tours only exist on boards with an even number of squares, because a loop needs the same number of light and dark squares. In this game you can aim for one on the 6×6 and 8×8 boards.

How old is the knight's tour?

The knight's tour is more than a thousand years old. The earliest known example appears in the Kavyalankara, a 9th century work on poetics by the Indian poet Rudrata, where the syllables of a verse are laid out on half a board in the order of a knight's moves.

Knight's tour problems later appear in chess writings of the Islamic world, and in 1759 the mathematician Leonhard Euler studied the puzzle in depth, publishing ways to build closed tours and several symmetric ones. In 1823 Warnsdorff offered a rule simple enough to use by hand. Today the knight's tour is a standard example of a Hamiltonian path in graph theory, and in 1997 Brendan McKay counted 13,267,364,410,532 undirected closed tours on the 8×8 board.

How do I finish a tour?

  1. Clear corners and edges first. A corner has only two ways in and out, so it is easily stranded if you leave it for later.
  2. Go where the fewest moves remain. That is Warnsdorff's rule. When two squares tie, pick the one nearer the edge.
  3. Watch for squares flashing red. A square that no longer has any way in turns red. Unless it can be your very last square, the path is already lost, so rewind early.
  4. Undo freely. Besides the one move and five move buttons, tapping a visited square twice rewinds straight back to it.
  5. Start small. 6×6 works from any start and is great for practice, while 5×5 and 7×7 are trickier than they look because of their start limits.

Controls

Your game in progress, best time for each board and closed tour count are stored only in this browser and never sent to a server. Anyone who opens a link from Share result can try the same board size and starting square.

Frequently asked questions

Is Knight's Tour free?

Yes. It is free with no sign up and works on computers, phones and tablets.

How does the knight move?

It jumps two squares horizontally or vertically and then one square to the side, in an L shape. A knight can reach up to 8 squares, and the game rings only the ones you have not visited yet in green.

Why can't I start on some squares of the 5×5 and 7×7 boards?

A knight alternates between light and dark squares on every jump. Boards with an odd number of squares have one extra square of the corner colour, so a full tour must start on that colour.

What is Warnsdorff's rule?

Move to the square that has the fewest onward moves. Published by Warnsdorff in 1823, it makes you handle easily stranded squares such as corners first, and it completes most 8×8 tours on the first try.

What is a closed tour?

A complete tour whose last square is one knight's jump from the first, so the path forms a loop. Closed tours only exist on the even 6×6 and 8×8 boards, and when you make one a glowing dashed line links the end back to the start.

What should I do when I get stuck?

Use Undo or Undo 5, or tap a visited square twice to rewind straight to it. If the path can no longer be finished, Hint finds how many moves back you need to go and marks that square in blue.

Do hints count against me?

The result card shows how many hints and undos you used. Your time still counts, but with more than three hints your title will not go higher than Squire.

What is different about the daily tour?

Everyone gets the same board size and starting square for the day. It changes at midnight Korea time, and your time is saved to the daily check in record when you finish.