Play free Chess against the computer at three levels, or with a friend on the same screen, with every rule of the game including castling, en passant and promotion.
Your move (White)
Pawn reaches the end: choose a piece
Moves
Playing Computer (Medium), you are White
Session You 0, Computer 0, Draws 0
Wins 0
Fifty-move count 0 of 50
Sky pieces are White and amber pieces are Black; Black pieces also carry a dark stripe. Click a piece, then a marked square: a dot is a move and a ring is a capture. Arrow keys move around the board, Enter or Space selects or moves, Escape puts a piece down. A pawn that reaches the far row asks which piece it becomes. Castle by moving the king two squares. The board turns itself so you play from the bottom; Flip board turns it back and forth.
Easy looks one move ahead and adds a large random bonus to every move, so it grabs free pieces but often walks into a recapture. Medium searches 3 moves ahead with alpha-beta pruning and then keeps going through captures, and picks at random among moves that score about the same. Hard deepens one move at a time up to 12 moves, keeps what it has already worked out in a table, tries the most promising moves first, and stops after about a second. It also knows a small book of opening lines written for this page. All three score a position by the pieces on the board and where they stand, with a bonus for two bishops and for driving a lone king to the edge in a won ending. It is a fixed search with no learning, so a careful player can beat it. A draw by repetition or the fifty-move rule is claimed by you with the button, and the computer claims one only when it does not think it is winning. Undo takes back your last move and the reply, and a game that used Undo is not counted as a result. Undo is not available once a game is over.
As-is, no warranty. These apps are free under their listed license and run entirely in your browser. Use at your own risk — don't blame me if your PC catches fire, your dog runs away, or the math turns out wrong. Verify anything that actually matters. None of this is professional financial, medical, legal, or engineering advice.
White moves first and the aim is to checkmate the other king: attack it so that no move can save it. The board has 64 squares and each side starts with 16 pieces. Pieces are drawn as simple shapes in two colours, and the two sides are told apart by more than colour: sky pieces are White, amber pieces are Black, and Black pieces also carry a dark stripe across the body.
Click or tap one of your pieces to select it. Every square it can legally reach is marked: a dot is a plain move and a ring is a capture. Click a marked square to move. Click the same piece again, or press Escape, to put it down. Pieces that can move carry a small mark in the corner of their square, the last move is tinted, and a king in check has a rose-coloured square and a note under the board.
The rules the page enforces:
Controls:
Keyboard: arrow keys move around the board, Home and End jump to the ends of a row, Enter or Space selects a piece or moves it, and Escape puts a piece down. Every square is announced with its name, piece and whether it is a legal move, and each move is spoken in full, such as “Knight from g1 to f3”. Moves are listed in standard algebraic notation (Nf3, exd5, O-O, e8=Q+). The board works at 320 pixels wide, and the page address stores your opponent, difficulty and side.
The engine has no dependencies. The board is 64 squares and a move is a small whole number holding the start square, end square, promotion piece and flags. Moves are made and unmade in place on one board while the position’s hash key, piece counts and evaluation are updated step by step. A generated move is kept only if it leaves the mover’s own king unattacked.
The move generator is checked against perft, the standard independent test: count every position reachable in a fixed number of legal moves and compare with published figures. The test suite pins these counts, all of which pass:
| Position | Depth 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|
| Starting position | 20 | 400 | 8,902 | 197,281 | 4,865,609 |
| The busy middlegame known as Kiwipete | 48 | 2,039 | 97,862 | 4,085,603 | |
| A rook and pawn ending with pins and en passant (position 3) | 14 | 191 | 2,812 | 43,238 | 674,624 |
| A position full of promotions and castling (position 4) | 6 | 264 | 9,467 | 422,333 | 15,833,292 |
| Position 5 | 44 | 1,486 | 62,379 | 2,103,487 | |
| Position 6 | 46 | 2,079 | 89,890 | 3,894,594 |
Position 3 also reaches depth 6 at 11,030,083, and a mirrored copy of position 4 gives the same figures as the original to depth 4. Five more positions covering promotion, castling, check evasion, en passant and bishops and rooks together are checked to depth 3 or 4. The start position is also checked move by move at depth 3, such as 600 positions after 1.e4.
The tests also pin: FEN round trips and rejection of impossible positions; every castling condition, one at a time; the en passant capture that would expose the king along a rank or a diagonal being refused; promotion for both sides with all four pieces; notation with disambiguation by file, rank and full square, where every legal move of a dozen positions turns into text and back to the same move; a famous 17-move game replayed to its checkmate; stalemate, checkmate, dead positions, repetition and the fifty-move rules; take-back restoring the exact position; and a colour-flipped copy of a position always scoring the same.
The computer comes in three levels, all searching with the same engine:
All three score a position by the pieces and where they stand, a bonus for two bishops, and in a won ending a bonus for driving the bare king to the edge and bringing the king close.
Checked by the suite: every level finds a mate in one and wins a hanging queen; Medium and Hard find a mate in two, verified by an exhaustive search rather than by the engine, and Hard finds a forced mate in five; Medium and Hard refuse a pawn that costs the queen; across 72 seeded games every move the computer chose was legal; Hard searching 4 moves deep never lost and won at least 5 of 6 games against Easy with the colours swapped, and Medium won at least 3 of 4. On busy positions the real Hard setting answers in about 0.7 to 1.1 seconds; the suite allows 2.5 seconds for a slow machine.
Nothing is uploaded and there is no account. Against the computer, your win count for each difficulty is saved in your browser’s local storage as small whole numbers in one small object. Clearing site data removes it. The session tally (your wins, the computer’s, draws) lives only on the page. Only finished games count. A game in which you used Undo is not counted against the computer, so the saved figures are not inflated.
Everything runs locally in your browser.
For informational purposes only. Not financial, medical, or legal advice. You are solely responsible for how you use these tools.