Chess

Play the computer. You are White. Pick Easy, Medium, or Hard.

Vs computer

Stockfish runs on this device. Unlimited undo.

How to play Chess

Play White against Stockfish as Black, with Easy, Medium, and Hard settings. Select a piece to see its legal destinations, then move it. This version uses an elapsed timer rather than a countdown chess clock.

Objective

Checkmate the black king: attack it so Black has no legal move that removes the attack. Your own king must remain safe after every move. The king is never captured.

Layout and setup

The 8-by-8 board starts in the standard position, with White at the bottom and Black at the top. Files are the columns a through h; ranks are rows 1 through 8. A square name such as e4 combines its file and rank.

Each side has a king, queen, two rooks, two bishops, two knights, and eight pawns. White’s back rank from a1 to h1 is rook, knight, bishop, queen, king, bishop, knight, rook; its pawns occupy rank 2. Black mirrors this on ranks 8 and 7. White moves first, then turns alternate.

Rules and allowed moves

Moving and capturing

Move one piece per turn, except for castling. Capture an opposing piece by moving to its square, removing it from the board. You cannot land on your own piece. Rooks, bishops, and queens cannot jump over pieces; knights can.

  • Rook: moves any number of clear squares horizontally or vertically.
  • Bishop: moves any number of clear squares diagonally.
  • Queen: combines rook and bishop movement.
  • Knight: moves two squares in one direction and one sideways, forming an L. From g1 it can initially reach f3 or h3.
  • King: moves one square in any direction, provided the destination is not attacked.
  • Pawn: moves one square forward into an empty square. From its starting square it may move two if both squares are empty. It captures one square diagonally forward, never straight ahead or backward. White pawns move toward rank 8; Black toward rank 1.

Check and legal moves

When your king is attacked, you are in check. Your next move must capture the attacker, block the attack if possible, or move the king to safety. No move may leave your king in check. An otherwise correct piece movement can therefore be unavailable because it exposes your king.

Castling

A king and rook that have never moved may castle if the squares between them are empty, the king is not in check, and it does not cross or land on an attacked square. Select your king and move it two squares toward the rook: e1 to g1 for kingside or e1 to c1 for queenside. The rook moves automatically to the square beside it.

En passant and promotion

Immediately after an opposing pawn advances two squares and lands beside your pawn, your pawn may capture it as though it had advanced only one square, if the move leaves your king safe. For example, White on e5 can capture a pawn just moved from d7 to d5 by moving to d6. This opportunity lasts one turn. A pawn reaching the far rank must promote to a queen, rook, bishop, or knight; choose in the promotion panel.

Winning, scoring, and getting stuck

Wins and draws

Checkmating Black wins; being checkmated loses. Stalemate is a draw: the side to move is not in check but has no legal move. This version also ends automatically on three occurrences of the same position with the same side to move and move rights, or 50 moves by each side without a pawn move or capture. You do not need to claim those draws.

The game also recognizes insufficient-material draws such as king against king, king and one bishop or knight against king, or kings and bishops confined to the same square color. Merely having a large material lead does not end a game.

Time, moves, and statistics

There is no time limit or points score. The toolbar shows elapsed time and the current move number; the completed-game move total counts each individual White or Black move. Wins, losses, and draws update local statistics. Reset or New game after you have moved in an unfinished game records a loss.

If the computer is loading or thinking, wait for Your move. If Computer failed to load appears, reload to retry; your position and timer are saved when browser storage is available.

Controls and features

  • Choose a move: click or tap a White piece, then a marked legal destination. To use the keyboard, Tab to a square and press Enter or Space to select it, then do the same for the destination.
  • Promotion: choose Queen, Rook, Bishop, or Knight after moving a pawn to the last rank.
  • Difficulty: Easy, Medium, and Hard change Stockfish’s settings for subsequent searches. You always play White, and changing the setting does not reset the board.
  • Undo: before the game ends, takes back your last move and the computer reply when one has been played. Wait until the computer finishes thinking and resume if paused. Undo does not rewind elapsed time and cannot change a recorded result.
  • Pause: stops the timer and blocks your moves. A computer reply that becomes ready while paused is applied after Resume.
  • Reset and New game: both return to the standard starting position and reset time. Any pending computer reply belongs to the old game and is discarded. Play becomes available once the computer finishes loading. Your position, move history, timer, difficulty, and statistics save in this browser when storage is available. Return and press Play to continue. Time away does not count.

Strategy tips

  • Before each move, check what your opponent attacks. A developing move can still lose a piece if you overlook a direct threat.
  • Develop knights and bishops toward useful squares before making repeated moves with one piece. More active pieces give you more choices.
  • Prepare castling by clearing the required path and keeping the king safe. Moving your king or rook first permanently removes that castling option.
  • Consider checks, captures, and threats for both sides. Before taking a piece, inspect what the opponent can recapture.
  • Use Undo to compare a concrete alternative. Identify what changed in the position rather than relying on a higher difficulty setting to teach the reason.

About Chess

Chess developed from earlier games including chaturanga in India. Its modern rules took shape in Europe and were standardized over time. Read more on Wikipedia.

For card games against computer opponents, try Hearts or Spades.

This game uses Stockfish. The bundled engine source information and license text are available here.

Frequently asked questions

Can I choose Black or play another person?
This version has you play White against Stockfish as Black. It does not offer a color selector or a two-person mode.
Why did the game call a draw without asking?
This version automatically ends on its repetition, fifty-move, stalemate, and insufficient-material conditions. It does not require a separate draw claim.
Will my position be saved?
Yes. Your board, move history, timer, and difficulty save in this browser when storage is available. Return and press Play to continue, including a pending computer turn. Time away does not count. Clearing site data removes saves; they do not sync between devices.