Skip to content
vladier

Play Chess Against the Computer

Choose a level and a color, then make your first move.

How to play

  1. Pick a level from 1 to 8 and choose to play White, Black or a random color. White always moves first.
  2. Move a piece by dragging it, or tap it and then tap a highlighted square. Dots show legal moves, and rings show captures. With a keyboard, use the arrow keys to move around the board and Enter to pick up and place a piece.
  3. When a pawn reaches the last rank, choose the piece it becomes. Castling and en passant work as in any standard game: move the king two squares to castle.
  4. Use Hint to see a strong move as an arrow, Take back to undo your last move, and Flip to turn the board around.

How the levels work

Each level limits how deep the engine searches and sets its built-in skill setting, which makes it choose weaker moves on purpose. On the lowest levels the computer also plays a share of completely random moves, so it really does leave pieces hanging, the way a new player does.

LevelWho it suits
1You just learned how the pieces move
2 to 3You play now and then and want a fair fight
4 to 5You know basic tactics and openings
6 to 7Experienced players looking for a hard game
8The engine at full strength for its move time

A good way to improve is to move up one level after you win two or three games in a row at the current one. Your record for each level is shown next to the board.

Tips to beat the computer

  • Control the center. Put pawns on e4, d4 (or e5, d5 as Black) and bring knights and bishops out early.
  • Castle early. A king in the middle of the board is the most common reason games are lost quickly.
  • Check every capture. Before each move, ask what your opponent can take. Most games at the lower levels are decided by pieces left undefended.
  • Trade when you are ahead. With an extra piece, swapping pieces makes your advantage easier to convert.
  • Learn basic mates. King and queen against king, and king and rook against king, come up often. Practice them here by trading down, and sharpen your eye for patterns with our chess puzzles.

The evaluation bar

Turn on the evaluation bar to see who is better. The white part grows when White is ahead and shrinks when Black is ahead. The score is in pawns: about +1 means White is up roughly a pawn’s worth. The bar is a quick engine estimate after each move, so it can change as the position gets clearer. If you enjoy board games against the computer, try checkers as well.

About the engine

The opponent is Stockfish, a free chess engine released under the GNU General Public License version 3, here in the lite single-threaded WebAssembly build of the stockfish.js project. The links under the board lead to the engine source code, the build source and the license text.

Questions

Which level should I start with?

If you know the rules but rarely play, start at level 1 or 2. If you play casually and know basic tactics, try level 3 or 4. Levels 6 to 8 are very strong, and level 8 plays at the engine’s full strength for the time it is given.

Can I take back a move?

Yes. Take back removes your last move and the computer’s reply, so it is your turn again. You can take back as many moves as you like, even after the game ends.

What is the chess engine?

The computer opponent is Stockfish, a free and open source chess engine, in a small build that runs inside your browser. Nothing is sent to a server, and the engine files load only when you start playing.

Is my game saved?

Your current game, level and color are saved in your browser, so you can close the page and continue later on the same device. Your win, draw and loss record is kept for each level.

When is a game a draw?

The game is drawn by stalemate, when the same position appears three times, when 50 moves by each side pass with no capture or pawn move, or when neither side has enough pieces left to checkmate.