
On today’s Chess Chats I’m going to showcase a pretty amazing TINY chess engine that’s written in Javascript and only 1024 bytes (yes, BYTES! 😲) in size! I’d previously played against my childhood chessbot nemesis, CHESS88, a DOS program from the 1980s and comparatively, it’s gargantuan at 9 kbytes!
The Kilobyte’s Gambit is available online for free and is inspired by the hit Netflix show, The Queen’s Gambit. I’d only discovered it this year and, in the video, I mistakenly thought that it was released in 2025. Further investigation while writing the article identified that it was actually released in 2021. The engine is adapted from code written by Oscar Toledo G who seems to have a passion for writing these tiny programs!
Now, I thought that a 1024 kb engine was impressive, but on his website one can find Toledo Atomchess, which is compiled in x86 machine code and is a staggering 326 bytes! And his code includes the logic for basic chess movements, with a search depth of 3! To put this into context, that is less data than the size of the text in this paragraph! 🤯
But back to The Kilobyte’s Gambit. How well did it play? I would argue that for a 1 kb program, it is enormously impressive! It played a tricky and offbeat opening (the Goldsmith Defense), and the engine punished my mistakes, and admittedly, I (arrogantly) played the game in a pretty haphazard manner. I think that the engine would have definitely beat me when I was a kid! The engine is prone to making mistakes and blunders though, so any time I played more solidly would result in me accruing an advantage.
The Chess.com game review shows this well. I regained the advantage each time I made a serious mistake.

Anyway, what do you think? Have you tried playing against this tiny chess engine and how did you find it? Let me know in the comments below!
* * *
Learn how to play the best chess opening attacks in the Romantic style with my new book, “Become a Chess Assassin!” available now on your local Amazon store!

[Event "?"]
[Site "?"]
[Date "2025.12.22"]
[Round "?"]
[White "vitualis"]
[Black "The Kilobyte's Gambit"]
[Result "1-0"]
[Link "https://www.chess.com/analysis/collection/computer-games-2acAycyqY/47uUT14R1x/analysis"]
1. e4 h5 $2 {[%c_effect
h5;square;h5;type;Mistake;size;100%2525;animated;false;persistent;true]
Goldsmith Defense $1 Interesting programmed choice $1} 2. Nc3 $6 {[%c_effect
c3;square;c3;type;Inaccuracy;persistent;true][%c_arrow
d2d4;keyPressed;none;opacity;0.8;from;d2;to;d4;persistent;false][%c_highlight
d4;keyPressed;none;opacity;0.8;square;d4;persistent;false] I knew d4 is clearly
best, but I wanted to see what the engine would do} 2... e5 $2 {[%c_effect
e5;square;e5;type;Mistake;persistent;true] It makes sense, but c5 is apparently
the most accurate. It can be difficult for engines to calculate in the opening
as there are so many legal moves.} 3. d4 $6 {[%c_effect
d4;square;d4;type;Inaccuracy;persistent;true] Another provocative move to see
what the engine would do} 3... exd4 4. Qxd4 a5 $2 {[%c_effect
a5;square;a5;type;Mistake;persistent;true][%c_arrow
b8c6;keyPressed;none;opacity;0.8;from;b8;to;c6;persistent;false][%c_highlight
c6;keyPressed;none;opacity;0.8;square;c6;persistent;false] I suspect that the
engine is programmed to play flank pawn moves} 5. Bc4 $6 {[%c_effect
c4;square;c4;type;Inaccuracy;persistent;true]} 5... Nc6 6. Qd5 {[%c_highlight
c4;keyPressed;none;opacity;0.8;square;c4;persistent;false,d5;keyPressed;none;opacity;0.8;square;d5;persistent;false,f7;keyPressed;alt;opacity;0.8;square;f7;persistent;false][%c_arrow
d5f7;keyPressed;none;opacity;0.8;from;d5;to;f7;persistent;false] Seeing whether
the engine will defend against checkmate} 6... Qe7 {It does $1} 7. Bf4 $6
{[%c_effect f4;square;f4;type;Inaccuracy;persistent;true][%c_arrow
c1g5;keyPressed;none;opacity;0.8;from;c1;to;g5;persistent;false][%c_highlight
g5;keyPressed;none;opacity;0.8;square;g5;persistent;false] Argh $1 I missed this
lovely trap $1} 7... Nf6 $1 {[%c_effect
f6;square;f6;type;GreatFind;persistent;true][%c_highlight
f6;keyPressed;alt;opacity;0.8;square;f6;persistent;false]} 8. Qd2 $4 {[%c_effect
d2;square;d2;type;Blunder;persistent;true][%c_highlight
d1;keyPressed;none;opacity;0.8;square;d1;persistent;false,d2;keyPressed;none;opacity;0.8;square;d2;persistent;false][%c_arrow
d5d1;keyPressed;none;opacity;0.8;from;d5;to;d1;persistent;false] Whoops $1} 8...
Nxe4 9. Nxe4 Qxe4+ 10. Qe2 {I realised that I blundered and thought I'd better
just cash how} 10... d5 $4 {[%c_effect
d5;square;d5;type;Blunder;size;100%2525;animated;false;persistent;true][%c_highlight
d5;keyPressed;none;opacity;0.8;square;d5;persistent;false] This move is a
blunder though} 11. Qxe4+ dxe4 12. O-O-O Bd6 13. Bxd6 cxd6 14. Rxd6 Ke7 15. Rd2
g5 16. f3 $6 {[%c_effect f3;square;f3;type;Inaccuracy;persistent;true][%c_arrow
h2h4;keyPressed;none;opacity;0.8;from;h2;to;h4;persistent;false][%c_highlight
h4;keyPressed;none;opacity;0.8;square;h4;persistent;false]} 16... Ne5 17. Bd5 e3
18. Re2 $4 {[%c_effect
e2;square;e2;type;Blunder;size;100%2525;animated;false;persistent;true][%c_arrow
d2d1;keyPressed;none;opacity;0.8;from;d2;to;d1;persistent;false][%c_highlight
d1;keyPressed;none;opacity;0.8;square;d1;persistent;false,e2;keyPressed;none;opacity;0.8;square;e2;persistent;false]
Whoops $1 I didn't realise that my bishop was lost until afterwards} 18... Rd8 $1
{[%c_effect d8;square;d8;type;GreatFind;persistent;true][%c_highlight
d8;keyPressed;alt;opacity;0.8;square;d8;persistent;false]} 19. Be4 f5 $1
{[%c_effect f5;square;f5;type;GreatFind;persistent;true][%c_highlight
f5;keyPressed;alt;opacity;0.8;square;f5;persistent;false] The engine trapped my
bishop $1} 20. Rxe3 fxe4 21. Rxe4 Ke6 $4 {[%c_effect
e6;square;e6;type;Blunder;size;100%2525;animated;false;persistent;true][%c_arrow
e7f6;keyPressed;none;opacity;0.8;from;e7;to;f6;persistent;false][%c_highlight
f6;keyPressed;none;opacity;0.8;square;f6;persistent;false,e6;keyPressed;none;opacity;0.8;square;e6;persistent;false]}
22. Ne2 $6 {[%c_arrow
f3f4;keyPressed;none;opacity;0.8;from;f3;to;f4;persistent;false][%c_highlight
f4;keyPressed;none;opacity;0.8;square;f4;persistent;false][%c_effect
e2;square;e2;type;Inaccuracy;persistent;true] I should have put pressure on the
pinned piece} 22... b5 $6 {[%c_effect
b5;square;b5;type;Inaccuracy;size;100%2525;animated;false;persistent;true]} 23.
Nd4+ $2 {[%c_effect d4;square;d4;type;Mistake;persistent;true][%c_arrow
h2h4;keyPressed;none;opacity;0.8;from;h2;to;h4;persistent;false][%c_highlight
h4;keyPressed;none;opacity;0.8;square;h4;persistent;false]} 23... Kd5 $4
{[%c_effect
d5;square;d5;type;Blunder;size;100%2525;animated;false;persistent;true][%c_highlight
d5;keyPressed;none;opacity;0.8;square;d5;persistent;false,f5;keyPressed;none;opacity;0.8;square;f5;persistent;false][%c_arrow
e6f5;keyPressed;none;opacity;0.8;from;e6;to;f5;persistent;false]} 24. Nxb5
{[%c_arrow
b5c7;keyPressed;none;opacity;0.8;from;b5;to;c7;persistent;false,c7a8;keyPressed;none;opacity;0.8;from;c7;to;a8;persistent;false,c7d5;keyPressed;none;opacity;0.8;from;c7;to;d5;persistent;false]}
24... Rd7 $2 {[%c_effect d7;square;d7;type;Mistake;persistent;true][%c_arrow
c8b7;keyPressed;none;opacity;0.8;from;c8;to;b7;persistent;false][%c_highlight
b7;keyPressed;none;opacity;0.8;square;b7;persistent;false]} 25. Nc3+ $1
{[%c_effect c3;square;c3;type;GreatFind;persistent;true][%c_highlight
c3;keyPressed;alt;opacity;0.8;square;c3;persistent;false]} 25... Ke6 26. Rhe1
Rd5 {Essentially, the engine is defeated} 27. Nxd5 Kxd5 28. Rxe5+ Kd6 29. Rxg5
h4 30. Rd1+ Kc7 31. Rg7+ Kb6 32. Rd6+ Kc5 33. Rd8 Bb7 34. Rxa8 Bxa8 35. Rh7 Bd5
36. Rxh4 Bxa2 $6 {[%c_effect a2;square;a2;type;Inaccuracy;persistent;true]} 37.
b3 Kb5 38. Kb2 Bxb3 39. cxb3 Kc6 40. Rc4+ Kb5 41. h4 Ka6 42. h5 Kb5 43. h6 a4
44. Rxa4 Kc6 45. h7 Kd7 46. h8=Q Ke6 47. Ra5 Ke7 48. Ra6 Kd7 49. Qh7+ Kc8 50.
Ra8# {[%c_effect
b2;square;b2;type;Winner;animated;true,c8;square;c8;type;CheckmateBlack;animated;true]
Good game, GG $1} 1-0
