EnglishEspañolPortuguêsFrançaisDeutschРусскийBahasa IndonesiaTiếng ViệtTürkçeالعربية

Playing Chess Against the Computer

An opponent that is always available, never tilts, and can be set to any strength. Here is how the engine decides its moves, which level to start on, and how to get real practice out of it.

Single wooden chess piece in sharp focus in the foreground with the soft blur of a glowing screen behind it

Playing a computer is how most people get their practice. It is available at three in the morning, it never resigns in a huff, and it will repeat the same position as many times as you need. The trick is picking a level that actually teaches you something.

Play the computer now

The five levels, and who each is for

LevelPlays likeUse it if
1Overlooks material, hangs piecesYou have just learned how the pieces move
2Sees one move ahead, takes free materialYou want to practise not blundering
3Roughly a casual club playerYou beat levels 1 and 2 comfortably
4Calculates several moves deepYou want a real fight
5Plays the best line it findsYou can already beat most people you know

The temptation is to jump straight to the hardest level, lose forty games, and conclude you are bad at chess. Resist it. You learn from games you nearly win, not from games you never understood.

A rule that works. Play the level you beat roughly one game in three. Below that you are being flattened and learning nothing; above it you are winning without being tested. Move up a level when you start winning more than half.

How the engine actually works

There is no mystery to it, and understanding the mechanism makes the engine's behaviour much less frustrating.

The engine uses negamax search with alpha-beta pruning — the same family of algorithm that powered every strong chess program before neural networks arrived, and still the backbone of most engines today. Three steps:

  1. Generate every legal move. In a typical middlegame position there are around thirty.
  2. Look ahead. For each move, assume you reply as well as possible, then it replies as well as possible, and so on to a fixed depth. The difficulty setting is essentially how deep this goes.
  3. Score the result. Each final position is evaluated by material count plus a table of values for where each piece stands — knights are worth more in the centre than on the rim, pawns are worth more as they advance, and so on. The move leading to the best worst-case is played.

Alpha-beta pruning is the optimisation that makes this practical: once a branch is proven worse than one already examined, the engine stops looking at it. It changes nothing about the move chosen but it cuts the work enormously, which is why the reply arrives in about a second rather than a minute.

At the lower levels, controlled randomness is injected into the evaluation. That is what makes level one hang pieces — not incompetence, but deliberate noise, so a beginner has something beatable to play against.

Everything runs on your device

The engine is JavaScript running in your browser. No move is sent to a server, nothing about your game is stored, and no account exists to hold a history. Once the page has loaded, the game continues even if your connection drops.

That is also why it will never be as strong as Stockfish. A serious engine is a large native program running on hardware you do not have in a browser tab. Ours is designed to be a good practice partner that loads instantly, not to compete with a supercomputer.

How to actually improve while playing an engine

Most people play the computer badly, in the sense that they get very little out of it. Three habits change that:

Slow down deliberately. The engine replies in a second, which tempts you to reply just as fast. Do not. Take fifteen seconds before every move to ask what the engine's last move threatened. Most losses against an engine come from answering quickly rather than from not knowing enough.

Use undo as a learning tool, not a rescue. When you lose a piece, take the move back and work out what you missed. That is worth more than starting a fresh game and making the same mistake again. If you undo without diagnosing, you are just deleting evidence.

Play the same opening repeatedly. Against a human, variety keeps things interesting. Against an engine, repetition is the point — play the same first moves twenty times and you will start to understand the resulting middlegames properly. Our five openings for beginners gives you a small repertoire worth drilling.

What an engine cannot teach you

Worth being honest about. An engine gives you no experience of an opponent who is also tired, also under time pressure, and also capable of panicking. It never falls for a trap out of impatience, and it never plays a speculative sacrifice because the position feels dangerous.

Those are real parts of competitive chess. If you eventually play in a club or a tournament, expect the human experience to feel different — in some ways harder, in some ways much easier. Engine practice sharpens your tactics; it does not prepare you for someone thinking across the table.

Where to go next

If you are being beaten by the computer more than you would like, our guide to beating the computer at chess covers the specific weaknesses engines at this level have. If you would rather play a person in the same room, two-player mode on one device needs no second account.

And if your tactics are the weak point — which for most people below 1500 they are — the engine-verified puzzles are a faster way to improve than playing more games.

Questions about the computer opponent

Can I play chess against a computer for free?
Yes. A browser-based engine runs on your own device, so there is no cost, no account and nothing to install. Unblocked Chess has a computer opponent with five difficulty levels built into the board on the home page.
What difficulty should a beginner start on?
Level one or two. Level one deliberately overlooks material and will hang pieces, which is exactly what a complete beginner needs — an opponent that never makes a mistake teaches nothing because you simply lose every game without learning why.
How does a chess computer decide its move?
It searches ahead. For each legal move it considers the opponent's best replies, then its own replies to those, scoring the resulting positions by material and piece placement. It then picks the move whose worst realistic outcome is best. This is called minimax search, usually with alpha-beta pruning to skip branches that cannot matter.
Is playing a computer good practice?
For tactics and consistency, yes. An engine never blunders out of tiredness, so it punishes your mistakes reliably. What it does not give you is the experience of playing a human who is also under pressure — which is a real part of competitive chess and worth getting elsewhere.
Why does the computer sometimes play a strange move?
At lower levels, randomness is added deliberately so the engine plays imperfectly and remains beatable. A move that looks pointless is usually the level doing its job. At the highest level the engine plays the best line it finds, and a strange-looking move is more likely to be one you have not understood yet.