A single-file chess app that runs completely offline in your browser — play against Stockfish at eight difficulty levels and get full post-game analysis. No account, no sign-up, no server, and no internet connection required.
Built because the free online sites started rate-limiting heavy use. This runs entirely on your own machine.
Download chess.html and double-click it (or open it in any modern browser:
Chrome, Firefox, Safari, or Edge). That's it — there is nothing to install and
no network connection is used at any point. The chess engine and rules library
are embedded directly inside the file.
- Play vs Stockfish, levels 1–8 — strength curve modeled on lichess's levels, from roughly 800 Elo up to 2400+. Level 4 is the default and is remembered between sessions.
- Click or drag — move pieces by clicking (with legal-move dots) or by dragging them to the target square. Last-move and check highlighting, pawn promotion picker, board flip.
- Appearance — choose from 8 board color themes and 5 piece styles (three embedded vector sets plus unicode symbols and letters). Your choice is remembered between sessions.
- Game management — play as White, Black, or random; takeback; resign; copy the move list or the full PGN to your clipboard.
- Opening detection — the opening name (Ruy López, Sicilian Najdorf, etc.) is shown and updated as you play.
- Move navigation — step through the game with the on-screen buttons or the arrow keys.
- Post-game analysis — runs Stockfish over every position and gives you:
- a win-probability Accuracy % for each side (the same style of metric lichess reports), plus average centipawn loss,
- an evaluation graph across the whole game,
- per-move inaccuracy / mistake / blunder marks (
?!,?,??) in the move list, - the engine's best move shown for any move you click.
The whole app is one self-contained HTML file. Two libraries are embedded inside it (base64-encoded) so nothing is ever fetched from the network:
- chess.js — move generation and rules (BSD license)
- Stockfish — the Stockfish 10 engine, asm.js build, compiled to JavaScript (GPL v3)
The original, un-embedded copies of these libraries are kept in the build/
directory, and build.py-style assembly is done by the build step described
below.
chess.html is generated by embedding the libraries in build/ into the source
template. To rebuild after editing:
- Ensure
build/chess.min.jsandbuild/stockfish.asm.jsare present. - Re-run the embedding step (base64-encode each file and substitute it into the
template's
__CHESS_JS_B64__/__SF_ASM_B64__placeholders).
This project bundles the Stockfish engine, which is licensed under the
GNU General Public License v3. Because Stockfish is embedded in chess.html,
the distributed combination is covered by the GPL v3 — see
stockfish.org and the
stockfish.js project for the engine and
its corresponding source. The complete engine source as distributed here is in
build/stockfish.asm.js.
The original application code in this repository (everything other than the bundled libraries) is additionally made available by the author under the MIT License — see LICENSE. chess.js is under the BSD license.
The bundled piece sets (Cburnett, Merida, Alpha) come from the lichess project and are used under their respective free licenses; see lichess's COPYING for details.