Chess
Chess is a two-player game on a board of sixty-four squares. Each side starts with sixteen pieces and wins by delivering checkmate: an attack on the enemy king that the king cannot escape, block or capture. This board plays the complete rules against a computer at three strengths, including castling, en passant, promotion to any of four pieces, stalemate, threefold repetition, the fifty-move rule and insufficient material.
New game starts a fresh game at the level you last chose. Take back lifts your last move and the computer’s reply together, and Hint names a move and says why. The three-dot menu at the end of the bar holds the level, whether you play White or Black, and the board flip.
Moves so far
Nothing yet. Every move you play is written here in algebraic notation — the same notation every chess book uses.
Your statistics · Club · White
- Played
- 0
- Won
- 0
- Win rate
- 0%
- Streak
- 0
- Best streak
- 0
- Best time
- —
This level
Four plies, with a four-ply capture search on the end of each one so an exchange is counted to the last recapture instead of being cut off mid-trade. It punishes a hanging piece at once and finds most two-move tactics.
Keyboard
- Arrows
- Move between squares
- Enter / Space
- Select a piece, or play the move
- Escape
- Clear the selection
- U
- Take back
- H
- Hint
- B
- Flip the board
- N
- New game
- F
- Full screen
- Board
- 8 × 8, 64 squares
- Pieces
- 16 a side, 32 in all
- First move
- 20 legal choices
- Levels
- Casual, Club, Sharp
How do you play chess?
White moves first, then the players alternate, one move each. Every move either moves one of your own pieces to an empty square or onto a square holding an enemy piece, which is then removed from the board. The single constraint that overrides everything else: you may never leave your own king under attack. That is where pins come from — a piece standing between your king and an enemy rook, bishop or queen simply has no legal move off that line. The goal is checkmate: attack the enemy king so that no legal move ends the attack.
| Piece | How it moves | Value |
|---|---|---|
| Pawn | One square forward, or two from its starting rank; captures diagonally | 100 |
| Knight | An L: two squares one way, one square the other. The only piece that jumps | 320 |
| Bishop | Any distance diagonally. It never leaves the colour of square it starts on | 330 |
| Rook | Any distance along a rank or a file | 500 |
| Queen | Any distance in any of the eight directions | 900 |
| King | One square in any direction, and it may castle once | — |
The values in that table are the ones this engine's evaluation actually uses, in hundredths of a pawn. Note that the bishop is worth ten points more than the knight rather than exactly the same: a bishop's range grows as the board empties, and a knight's does not. The king has no value in the table because losing it is not a cost the search prices — it is the end of the game, scored separately.
What is the difference between check, checkmate and stalemate?
Check is an attack on the king. You must answer it on your very next move, by moving the king, capturing the attacker, or putting something in the way — and if none of those is possible, the check is checkmate and the game ends immediately. Stalemate is the one that costs players whole games: you have no legal move at all and your king is not attacked. That is a draw, worth half a point to each side, no matter how far ahead the other player was.
The practical lesson is a defensive one. A lone king with no pawns, shuffled into a corner while the stronger side queens a pawn without checking first, is drawn far more often than beginners expect. When you are winning, count your opponent's legal moves before you take a square away from them; when you are losing, look for the move that leaves you with none.
Which chess rules do most browser versions get wrong?
- Castling through check. The king may not castle out of check, through an attacked square, or onto one. What is not forbidden: the rook passing over an attacked square, and — castling queen-side — the b-file square being attacked. The king never stands on b1, so only its own three squares are tested.
- Castling queen-side needs three empty squares, b1, c1 and d1, not two. A knight still on b1 blocks it.
- Losing the right by capture. Castling is lost when the rook is taken on its home square, not only when it moves. A version that forgets this lets you castle with a rook that is no longer on the board.
- En passant expires. The capture is available on the move immediately after the double push and never again. It is also the only capture where the captured piece is not on the square you land on.
- Under-promotion is legal. A pawn reaching the last rank must become a queen, rook, bishop or knight — your choice, and a knight is occasionally the right one because it is the only promotion that can give check on a square a queen cannot reach.
- Two knights is not insufficient material. King and two knights against a bare king cannot force mate, but mate is still reachable, so the game is not dead and it is not drawn here. King and one bishop, king and one knight, and bishops of the same colour on opposite sides all are.
How strong is the computer opponent?
It is a minimax search with alpha-beta pruning and piece-square tables — the same family of engine as this site's checkers and Four in a Row opponents, scaled up. It deepens one ply at a time and stops the moment it runs out of its budget in positions, throwing away the half-finished depth and playing the last one it completed — so a tangled middlegame costs the same ceiling of work as a quiet one instead of however long the position happens to take. Past the end of the main search it keeps looking at captures only, which is what stops it grabbing a defended pawn and calling the position winning one move before the recapture.
| Level | Plies | Capture search | Positions per move, at most |
|---|---|---|---|
| Casual | 2 | None | 20,000 |
| Club | 4 | 4 plies | 150,000 |
| Sharp | 5 | 6 plies | 400,000 |
Casual is genuinely weak and genuinely honest about it: two plies with no capture search means it sees your threat and its own answer and nothing else, so it will take a defended pawn and walk into a fork that is two moves away. It never plays a random move, though — every move is the best its short search can see. Sharp plays the highest-rated move every time; Casual and Club pick from every move within 40 and 16 hundredths of a pawn of the best, which is what stops every game from being the same game.
How many chess positions are there?
From the opening position White has exactly 20 legal moves — sixteen pawn moves and four knight moves — and after one move each there are 400 positions. Three plies gives 8,902, four gives 197,281, and five gives 4,865,609. Those counts are the standard correctness probe for a chess move generator, because a rule implemented slightly wrong changes them: this site's generator reproduces every one, along with the published counts for five awkward test positions full of pins, en passant captures and promotions.
| Plies | Positions |
|---|---|
| 1 | 20 |
| 2 | 400 |
| 3 | 8,902 |
| 4 | 197,281 |
| 5 | 4,865,609 |
The growth does not stop. Claude Shannon's 1950 paper put the number of typical games at somewhere around 10^120 — far more than there are atoms in the observable universe — which is why no chess program searches the whole tree and why every one of them, including this one, has to decide what to look at and what to ignore.
How do you get better at chess?
- Move a piece once in the opening, not twiceEvery move you spend moving the same knight again is a move your opponent spends bringing a new piece out, and you never get it back. The opening is not decided by which squares you chose so much as by how many moves each side spent not developing — which is also why the computer punishes an early queen sortie: you chase it, it develops.
- Castle early, usually by move tenA king left in the middle is on the file that opens first when pawns are traded, and it blocks your own rooks from connecting along the back rank. Castling solves both in one move, which is why it is the only move in chess that moves two pieces.
- Count the defenders before you takeBefore any capture, count how many pieces attack the square and how many defend it, and take the cheapest piece first. The computer at Club and Sharp looks at captures past the end of its main search precisely so it can count the whole exchange, and it will punish a capture you counted one deep.
- Look at your opponent's last move before your ownAsk what it attacks that it did not attack before. Most beginner losses are not deep tactics — they are a bishop that quietly started eyeing f7 two moves ago and was never looked at, and one question a move would have caught it.
- In the endgame, walk the king forwardWith the queens off, the king stops being a liability and becomes a strong piece, worth roughly a minor piece in fighting value. This engine's evaluation blends its king table towards the centre as material comes off, for exactly that reason — a king on e4 in a pawn endgame is often worth more than the pawn you spent getting it there.
- When you are ahead, trade pieces and not pawnsAn extra piece matters more the fewer pieces are left, and pawns are what you need to promote once the pieces are gone. Trade a bishop up to a rook up and the win gets easier; trade your last pawn off and a bishop up becomes nothing at all. King and one bishop against a bare king, or king and one knight against a bare king, is not a hard win — it is not a win, and this board ends it as a draw on the spot for insufficient material.
Chess questions people ask
- Can I castle out of check?
- No. The king may not castle while it is attacked, may not pass over an attacked square, and may not land on one. The rook is allowed to pass over an attacked square, and queen-side the b-file square may be attacked, because the king never stands there.
- How long does en passant stay available?
- Exactly one move. If your opponent pushes a pawn two squares past your pawn and you do not capture it immediately, the chance is gone for the rest of the game.
- Do I have to promote a pawn to a queen?
- No, and you cannot leave it as a pawn either. A pawn reaching the last rank becomes a queen, rook, bishop or knight. This board asks you which one every time rather than assuming a queen, because a knight promotion with check is sometimes the only move that wins.
- Why did my winning game end in a draw?
- Most likely stalemate — your opponent had no legal move and was not in check. It can also be threefold repetition, fifty moves each with no capture and no pawn move, or neither side having the material left to mate.
- Can I take a move back?
- Yes. Take back lifts your last move and the computer's reply together, so the board comes back to you with the same side to move. There is no limit on it, and the move list beside the board shows every move in algebraic notation.
- Does this work offline?
- Yes. The board, the rules and the opponent all run in your browser, so once the page has loaded there is nothing to reach for. The same is true inside the Android and iOS apps, which are this page in a native shell.
The rules in six lines
- 1Set the board upEight ranks by eight files, with a light square in the right-hand corner nearest each player. Rooks on the corners, then knights, then bishops, then the queen on her own colour and the king beside her. Pawns fill the second rank.
- 2White moves first, then alternateOne move each, all the way to the end. There is no passing: if it is your turn you must make a legal move, and having none is either checkmate or stalemate.
- 3Move the pieces as they moveRooks along ranks and files, bishops along diagonals, the queen either way, the knight in an L and over anything in the way, the king one square at a time. Pawns go forward and capture diagonally.
- 4Never leave your own king attackedA move that would expose your king to capture is not a legal move, which is what makes a pinned piece unable to leave the line between the king and the attacker. If you are in check you must answer it at once.
- 5Castle once, if you still canMove the king two squares toward a rook that has not moved and slide that rook past it, provided the squares between are empty, the king is not in check, and it neither crosses nor lands on an attacked square.
- 6Take en passant while you canWhen an enemy pawn steps two squares and lands beside yours, you may capture it on the square it skipped — but only on your very next move. The pawn you take is not on the square you move to.
- 7Promote a pawn that reaches the endA pawn arriving on the last rank is replaced immediately by a queen, rook, bishop or knight of its own colour. It may not stay a pawn, and you may have more than one queen.
- 8Win by checkmate, or drawCheckmate ends the game at once. A draw follows from stalemate, from the same position appearing three times, from fifty moves each with no capture and no pawn move, or from neither side having enough material to mate.
The long version, with worked examples and the questions beginners actually ask, is on how to play chess.
Put Chess on your own site
The board runs in an iframe with no tracking, no cookies and no sign-up. Paste this wherever you want it. See all the embeddable games for the rest.
<iframe src="https://www.cardgamenook.com/embed/chess" width="100%" height="620" style="border:0;border-radius:10px;max-width:900px" title="Chess — free online" loading="lazy"></iframe>
<p style="font:14px system-ui;margin:6px 0 0"><a href="https://www.cardgamenook.com/chess">Play Chess</a> at Card Game Nook</p>