Play Hex Online
Connect your two sides of the board with an unbroken chain of stones before your opponent does. A timeless strategy game with no possibility of a draw.
Created by Brian Hamilton
Red connects top ↔ bottom • Blue connects left ↔ right
How to play Hex
Take turns placing stones. Connect your two opposite sides to win.
- Red joins top to bottom; Blue joins left to right.
- Stones are never moved or captured — once placed, they stay.
- Hex can never be drawn. Fill the board any way at all and exactly one player has connected.
- Two stones with two shared empty neighbours form a bridge: already connected, because blocking one cell leaves the other.
- The swap rule lets the second player take the first stone instead of replying — it exists because the first player otherwise has a proven winning strategy.
Controls: tap any empty hexagon to place a stone. Choose the board size and AI difficulty, or two-player mode, above the board.
Hex cannot be drawn, and that changes everything
Fill a Hex board completely, any way at all — colour the cells at random if you like — and exactly one player has connected their two sides. Never neither. Never both. It is a theorem, not a tendency.
Which means there is no such thing as a defensive draw. You cannot play for safety, because safety does not exist as an outcome. Every move you make to block your opponent is simultaneously a move towards your own connection, and every move that fails to do both is wasted.
Blocking and connecting are the same move
This follows directly. If your opponent cannot connect, you have connected — there is no third option. So a stone placed squarely across their best route is not a defensive move at all: it is your route.
The practical version: when you are unsure what to play, find the shortest chain your opponent still needs and put a stone in the middle of it. You have lengthened their path and shortened your own with one move. Players who think of Hex as attack-or-defend are solving a problem the game does not have.
Learn the bridge before anything else
Two of your stones placed a short diagonal apart, with two empty cells touching both, are already connected. If your opponent takes one of those cells, you take the other. There is nothing they can do about it, so the link needs no move spent on it now.
That is what lets strong players cover ground so fast. A chain of bridges spans the board using half as many stones as a solid line, and every link in it is unbreakable. Filling a bridge in yourself is the commonest beginner's error: it wastes a move to buy something you already owned.
The exception that matters: a bridge is only safe while both its cells are empty. Once one is taken, the other is forced — play it immediately. Leaving it for later is how a safe position becomes a lost one.
The first player wins, so good versions cheat
There is a famous argument, due to John Nash, that the first player must have a winning strategy. Suppose the second player had one. The first player could simply make any move, then pretend to be the second player and follow that strategy — an extra stone on the board can never hurt in Hex, since stones are never captured or moved. So they would win too, and both players cannot have winning strategies. Therefore the second player does not.
The argument proves a winning strategy exists without giving the faintest hint what it is. Nobody knows it for a full-sized board. That is why this version offers the swap rule: after the first stone is placed, the second player may take it and change sides. It makes the opening move a genuine decision — play something too strong and it gets taken from you.
Where players go wrong
Playing along your own edge. Your edge is where you finish, not where you build. The middle of the board is worth far more, because a stone there is on the way to both sides.
Solid chains. Stones placed touching each other cover half the ground per move that bridges do. Use contact only where a bridge will not fit.
Answering every threat locally. Because blocking and connecting are the same thing, the reply to a threat is often somewhere else entirely — wherever most shortens your own path.
Forgetting a bridge is under attack. The one situation that really is forced.
What was verified on this page
The no-draw theorem is not just quoted here, it is checked. Every one of the 65,536 ways to fill a 4×4 board, and all 512 ways to fill a 3×3, were tested: exactly one winner in every single case, never zero and never two. The split was precisely even — 32,768 each — which is the symmetry of the game showing up in the arithmetic.
That check is worth more than it looks. Hex's neighbour relation is easy to get subtly wrong, and a wrong one produces boards that are drawn. Getting exactly one winner every time, at every board size the page offers, confirms the geometry and the win detector together. Win detection was separately compared with an independent search across 18,000 mid-game positions, and every winning chain it reports was confirmed to be genuinely connected and to touch both edges.
One honest finding about the difficulty settings. Medium beats Easy in every game tested, at both board sizes. But Hard and Medium are level on a 7×7 board, and on 11×11 Hard wins only 6 games in 26. Its extra move of lookahead does work — against a version of itself without it, Hard wins 24 of 26 — but Medium's simpler shortest-path play scales better to the larger board. If you want the stronger opponent on a big board, Medium is currently it.
| Matchup | 7×7 | 11×11 |
|---|---|---|
| Medium beats Easy | 26/26 | 26/26 |
| Hard beats Medium | 14/26 | 6/26 |
A game invented twice
Piet Hein introduced Hex in a Danish newspaper in 1942; John Nash rediscovered it independently at Princeton a few years later, where it was played on the common-room floor tiles and known for a while as Nash. Nash's strategy-stealing argument came with it.
It has stayed interesting for the reason above: the rules take one sentence, the first-player win is proved, and the actual winning strategy is unknown on any board large enough to be worth playing. Few games are so completely understood and so completely unsolved at the same time.
More games like this
If you like games where connection matters more than capture, try these: