Welcome to Chess!

This is a JavaScript implementation of Chess using the HTML5 canvas. Features include:

How to play

The player whose turn it is is indicated on the sidebar, at the top. White is first to move.

To make a move, click the desired piece. Its valid moves will be displayed. Then, click the target location. A piece can be deselected by clicking on it, another piece, or any square which is not a valid move location.

If desired, the board can be rotated to place black at the bottom by clicking the "Flip Board" button on the sidebar.

How to win

An image of the king piece An image of the king piece
The goal of the game is to put your opponent's king into checkmate. Checkmate is a situation where the enemy king is both threatened by one of your pieces, and can make no moves to save the king. Moves to save the king include moves made by pieces other than the king, such as moves to block a check (when one or more pieces threaten the king) or to capture the checking piece.

It is also possible to lose if you run out of time. Timers are shown on the right of the bar for each player, above and below the board. In this implementation, each player starts with 10 minutes and cannot gain more time.

The game will tie if a stalemate occurs, a situation in which a player's king is not in check, and they have no valid moves left. This is not a win, since the king is not in check.

Other stalemate conditions in chess exist based on move repetition or unwinnable board states, but they have not been implemented.

Pawn Promotion

Select the new piece for the pawn on a8.

Game Over

White wins by checkmate!

Black 10:00
White 10:00