Gomoku (Five in a Row) Against the Computer or a Friend
Take turns placing stones. The first player to get five in an unbroken line across, down or diagonally wins.
Runs in your browser. Your files never leave your device. See how to check
…
How to do it
- 1Choose an opponent
Computer or friend.
- 2Pick board and rule
15 or 19; freestyle or exactly five.
- 3Place stones
Black first.
- 4Block threats
Fours and open threes.
- 5Make five in a row
To win.
About this tool
Gomoku, also called five in a row, is one of the simplest strategy games to learn: two players take turns placing black and white stones on the intersections of a grid, and the first to make an unbroken line of five wins. It has been played in Japan for centuries on Go boards and is close to the pencil-and-paper game many children know as noughts and crosses with five. Underneath the simple rule lies a sharp tactical game of threats and double threats. This version lets you play the computer or a friend on the same device, with the two most common rule sets.
How to play here
Choose an opponent, a board size and a rule, then click an intersection to place a stone. Black always moves first. The latest stone has a red ring so you can follow the game. Undo takes back the last move, or the last pair of moves against the computer.
Rule sets
**Freestyle gomoku:** five or more stones in a row win.
**Standard gomoku:** exactly five wins; a line of six or more (an overline) does not.
**Renju**, the professional form, adds restrictions on Black, who has a big first-move advantage: Black may not make overlines, double fours or double threes. Those restrictions are not applied here.
Tactics
- **Open three:** three in a row with both ends open. It threatens to become an open four, so it must usually be answered. - **Four:** four in a row with one end open. It must be blocked at once. - **Open four:** four with both ends open. It cannot be stopped, so it wins. - **Double threat:** a move that creates two threats at once, such as four-three or three-three, usually wins because the opponent can block only one.
The skill of gomoku is building positions where you can create a double threat while answering your opponent's threats.
The computer player
The computer scores every empty point near existing stones by the lines it would make for itself and the lines it would block for you, then plays the best. You can make it more attacking, balanced or more defensive. It answers fours and open threes reliably but can miss deeper combinations, so it is beatable with good tactics.
Board sizes
The 15 × 15 board is standard for modern gomoku and renju. A 19 × 19 Go board gives more room and longer games.
Why Black has the advantage
Mathematicians have shown that in freestyle gomoku on a 15 × 15 board, the first player can always force a win with perfect play. That is why tournaments use opening rules and why renju restricts Black. For casual games, alternating colours keeps things fair.
## Playing with children Gomoku is a good step up from noughts and crosses: children learn to look for threats and to plan two moves ahead.
Limits
The computer is a casual opponent, not a tournament engine. Everything runs in your browser.
Worked example
Five black stones in an unbroken diagonal win the game.
Quick facts
- Category: Games & Fun
- Works in your browser, no sign-up, no upload.
- Your input stays on your device.
- Available in English.
- Content last reviewed:
- Official source: Gomoku rules as described by the Renju International Federation (freestyle and standard gomoku); renju restrictions are not applied
Frequently asked questions
What are the rules of gomoku?
Take turns placing stones; five in a row wins.
Does six in a row win?
In freestyle yes; under the exactly-five rule, no.
Who moves first?
Black.
What is an open four?
Four in a row with both ends empty; it cannot be stopped.
Can two people play?
Yes, choose a friend on this device.
Is anything stored?
No. The game runs in your browser.
