Play Gomoku Online
Place stones on a 15×15 board and be the first to line up five in a row — horizontally, vertically, or diagonally. Play versus AI at three difficulty levels or pass-and-play with a friend.
Created by Brian Hamilton
How to play Gomoku
Take turns placing stones. The first to get five in a row wins.
- Five in a row along a row, column or diagonal wins.
- Six or more also wins on this board — these are freestyle rules, unlike tournament gomoku which needs exactly five.
- Stones never move and are never captured.
- A three with both ends open must be answered at once: it has two ways to become an unstoppable four.
- Two open threes at the same time cannot both be blocked. That is how games are won.
Controls: tap or click any empty intersection to place a stone. Choose the AI difficulty, or two-player mode, above the board.
Missed a threat? Use the Gomoku calculator — set up any position and it will name every open three, four and double threat on the board, for both players.
Make two threats at once and the game is over
Gomoku looks like a race to five. It is really a race to a position your opponent cannot answer — and there is exactly one way to build that: threaten to win in two places at the same time. A single threat gets blocked. Two do not.
Playing out full games and watching for the moment one side first created a double threat or an unblockable four: that player went on to win every single game. Not most. All twenty-four. Everything else in the game is manoeuvring towards that one moment.
Learn to see the open three
Everything follows from one distinction. A run of three with both ends empty is an open three. A run of three with one end already blocked is nearly harmless.
The difference is what happens when it grows. Extend an open three and you get a four with two squares that would complete five — your opponent can only cover one. Extend a blocked three and you get a four with a single completing square, which is simply blocked. That is the whole of gomoku tactics in one sentence: an open three must be answered on the move it appears, and a blocked three can usually be left alone.
When you are the one attacking, this tells you what to aim for: not long lines, but intersections. Look for the square where two of your half-built lines cross. Playing there turns both into threats at once, and no single reply covers both.
Six in a row also wins here
Worth knowing, because rulesets differ and this one is not universal. On this board an overline — six or more in a row — counts as a win, the same as exactly five. These are “freestyle” rules.
Tournament gomoku often does the opposite: it requires exactly five, so an overline is not a win at all, and a line of six that contains no clean five is worthless. It also usually handicaps the first player, because the free game is too good for them. None of that applies here. If you build six, you have won.
Play the centre, and stay near the stones
A line needs room at both ends, and only the middle of the board has room in every direction. A stone on the edge can build in half as many directions as one in the centre, which is why every serious game starts in the middle and stays there.
The corollary matters more than it sounds: a stone played away from the action is a wasted move. Gomoku has no material and no position to accumulate — the only thing a stone does is extend a line or block one. A stone doing neither has given your opponent a free tempo, and a free tempo is often exactly what they needed to reach an intersection first.
Where players go wrong
Blocking the wrong end. Facing an open three, blocking either end leaves the other. What you actually need is to check whether blocking creates a threat of your own, and if not, whether you have a faster attack.
Answering a blocked three. Spending a move to block a three that was never going to become an open four is how you fall a tempo behind.
Building one long line. Four in a row with both ends blocked is worth nothing at all. Two threes that cross are worth the game.
Watching only your own attack. Because a double threat ends the game immediately, you have to check every move whether your opponent is one stone away from making one — the block has to come before your attack.
What was verified on this page
Win detection was checked against an independently written scanner — one that sweeps the whole board rather than looking around the last stone — across 488 positions and 1,464 individual placements. They agree everywhere, including about overlines.
The most important check concerns how the AI decides. Before it searches at all, it looks for a move that wins immediately, then for one that blocks the opponent winning immediately. Both use the same routine, so if that routine ever missed a square the AI would hand over games. It was compared against an exhaustive square-by-square search on 976 position-and-colour pairs: it found every winning point and never invented one.
The search itself only examines the eight most promising squares near existing stones, which is what makes a 225-square board tractable at all. That pruning was checked too: across those 488 positions, the shortlist never once excluded a square that won or a square that had to be blocked.
| Matchup | Deeper side wins | Loses |
|---|---|---|
| Hard (depth 4) vs Medium (2) | 12 | 0 |
| Medium (depth 2) vs Easy (1) | 12 | 0 |
A solved game you would never guess was solved
Free-rule gomoku on a 15×15 board was solved by Victor Allis in 1994: the first player wins with perfect play. That is why tournament rules go to such lengths to handicap the opening — the unmodified game is not fair.
You would not know it from playing, though, and the measurements show why. At the depth this page searches, the first player won 9 of 24 self-played games and the second won 15. The theoretical advantage is real but it lives several moves deeper than any practical search reaches: Allis found it with a specialised threat-space search, not by looking further ahead in the ordinary way. A proven win you cannot actually find is, from the board's point of view, not much of a win.
More games like this
If you like games decided by the threat that cannot be answered, try these:
4 in a Row
Drop discs and connect four in a row — play vs AI or a friend.