Chess Endgame Trainer
Pick an endgame, get a starting position, and try to checkmate the computer before the fifty-move rule or a stalemate stops you.
What the chess endgame trainer does
A chess endgame is the final stage of a game, when only a few pieces are left on the board. This chess endgame trainer lets you practise winning basic endgames against the computer, right in your browser. You play White and move first, and your goal is checkmate.
You can choose from five endings: king and queen vs king, king and rook vs king, king and pawn vs king, two rooks vs king, and the Lucena position (rook and pawn vs rook). The computer defends with js-chess-engine, an open-source (MIT) engine that also runs in your browser. You can set its strength from Level 1 (beginner) to Level 5 (hardest).
Each ending teaches a method you can reuse in real games, from restricting the enemy king to delivering a clean mate. Nothing is uploaded.

How to use the chess endgame trainer
- Open the 'Endgame' menu and pick one of the five endings: King and queen vs king, King and rook vs king, King and pawn vs king, Two rooks vs king, or Lucena position.
- Set 'Computer level' from Level 1 (beginner) to Level 5 (hardest).
- For the queen, rook and two-rook endings, press 'New position' to get a random legal start. King and pawn starts are fixed, and the Lucena position always starts from the same setup.
- Make your move as White. The computer answers. In some king and pawn starts, the computer moves first.
- Read the counter line. It shows your moves, the fifty-move counter (x / 50, which resets after a capture or a pawn move) and the position number.
- If you are stuck, press 'Hint'. It marks the square of the piece to move. Press 'Hint: show the move' to see the whole move.
- When you mate, you will see 'Checkmate in N moves!'. If the game fails, the trainer explains why. Press 'Same position again' to replay the same start.
Use 'Flip board' to turn the board. The position number also appears in the address bar as ?seed=. Opening that address gives you the same start again. Pawns promote to a queen automatically.
How do you practise chess endgames?
Practise one ending at a time, starting with the simplest, and replay the same start until you can mate in fewer moves. Set 'Computer level' to a strength you can still beat, then raise it as your results improve.
Every game here has one goal: checkmate. Three kinds of result stop a win, so learn to spot them:
When you fail, the trainer names the reason. Press 'Same position again' and try a different plan. Use 'Hint' only after you have tried the position yourself.
- Stalemate: the side to move has no legal move but is not in check. The game is a draw.
- Insufficient material: neither side has enough pieces to deliver mate, so the game is a draw.
- Threefold repetition or the fifty-move rule: the game is a draw if the same position appears three times, or if fifty moves pass without a capture or pawn move.
How do you checkmate with a king and rook?
Use your rook to cut the enemy king off along a rank or file, so it cannot cross to the other side of the board. Then bring your own king up opposite the enemy king. Push the enemy king toward the edge one line at a time, and finish with mate on the edge, where it has nowhere to run.
Keep the rook on the line that blocks the king, and move it only when the king must stay boxed in. Your king does the pushing. If the enemy king steps toward the rook, slide the rook along the same line to keep the cut-off.
How do you checkmate with a king and queen?
Use the queen to shrink the box the enemy king can move in. A good habit is to place the queen a knight's move away from the king, which takes away many squares at once. Keep shrinking the box until the king is on the edge of the board.
Then stop pushing with the queen: the enemy king may have no move left, and a position where it is not in check but cannot move is stalemate, a draw. Bring your own king up next to the enemy king and give mate on the edge with the queen protected by your king.
How do you win king and pawn against king?
The attacking king belongs in front of its pawn, not behind it. With your king on the sixth rank directly in front of a pawn that is not on the a- or h-file, the position is a win whoever is to move. The trainer's king and pawn starts put your king on the sixth rank in front of or beside the pawn's path, and every one of them was checked by an exhaustive search to be a win, so a draw means the technique went wrong somewhere.
Examples
Questions and answers
What is the Lucena position?
The Lucena position is a rook and pawn vs rook ending, and it is one of the five endings in the trainer. It is Kb8, pawn b7, rook c1 against Kd8 and rook a2, with White to move. The standard winning method is "building a bridge": the rook goes to the fourth rank so it can block the enemy rook's checks after your king leaves the promotion square.
Which endgames should beginners learn first?
Start with king and queen vs king, then king and rook vs king. Both teach you to restrict the enemy king and mate it on the edge. Next, try two rooks vs king and king and pawn vs king, and save the Lucena position for last, because it needs a specific plan.
What are good chess endgame tips?
Bring your king into the game early, since in most endings it is a strong piece. Before each move, check that you are not stalemating the enemy king. Keep an eye on the fifty-move counter so you know how many moves remain before a draw.
Are the hints perfect?
No. Hints come from a short search, not from endgame tablebases, so following every hint does not always win. A hinted line can run into the fifty-move rule or a repetition, so check where it leads before you play it.
Can the computer move first?
Yes. In some of the 72 fixed king and pawn starts, the computer moves first, so read the board before you press anything.
Related chess tools
Open-source components used by this tool: js-chess-engine (MIT); chess.js (BSD-2-Clause).
Updated