Gomoku (Five in a Row)
Play Gomoku (five in a row) free in your browser: 3 AI levels, 2-player mode, 15×15, 19×19 or a large 30×30 board, caro rules, undo, hints and autosave.
What Is Gomoku (Five in a Row)?
Gomoku, also called five in a row, gobang or connect five, is a two-player strategy game played on a grid. Players take turns placing a mark – X and O, or black and white stones – on an empty cell, and the first to make an unbroken line of five wins. The rules take ten seconds to learn, yet the game hides deep tactics: open threes, fours, double threats and long forcing sequences. Gomoku is played around the world under different names: in Japan it is gomoku narabe, in Korea omok, in Vietnam cờ caro, and its professional variant with opening restrictions is called renju. This free online version lets you play against a computer opponent with three difficulty levels or against a friend on the same device, on a classic 15×15 board, a 19×19 Go-sized board or a large 30×30 board that feels like playing caro on squared paper.
Gomoku Rules and Variants Supported
- Freestyle: a line of five or more of your marks wins. This is the most common casual rule and the default here.
- Exactly five: only a line of exactly five wins; an overline of six or more does not count. This is the rule of standard gomoku tournaments.
- Caro (blocked both ends): popular in Vietnam – a line of five or more wins only if it is not blocked by your opponent's marks at both ends. The board edge does not count as a block.
- First move: X (Black) always moves first. Against the computer you can choose whether you or the computer starts.
- Draw: if the whole board fills up without a valid five, the game is a draw – rare on a 15×15 board and almost impossible on 30×30.
Features
- Three AI levels: Easy for beginners, Medium that sees a few moves ahead, and Hard that searches deeply and spots forced wins by continuous fours.
- Non-blocking AI: the computer thinks in a Web Worker, so the page never freezes, even on phones.
- Local 2-player mode for playing with a friend on one phone, tablet or computer.
- Board sizes: 15×15 (standard gomoku), 19×19 (Go board) and 30×30 for a large caro feel.
- Three rule sets: freestyle, exactly five and Vietnamese caro (blocked both ends does not win).
- Two piece styles: classic X/O on squared paper or black and white stones on a wooden board.
- Last move and winning line highlighted so you never miss what just happened.
- Undo, hints and move counter; the hint button asks the Hard engine for the best move.
- Score tally across games, separately for vs Computer and 2-player mode.
- Autosave: reload the page or come back tomorrow and your game is still there.
- Mobile friendly: the board fits a 390 px phone, with zoom buttons, scrolling for large boards and an optional tap-twice-to-confirm mode against misclicks.
- Dark mode, sound effects and no registration or download.
How to Play Gomoku Online Here
- Choose vs Computer or 2 Players in Game mode.
- Against the computer, pick a difficulty and decide who moves first.
- Select a board size (15×15, 19×19 or 30×30) and a rule: Freestyle, Exactly five or Caro.
- Click or tap an empty cell to place your mark. On small screens, turn on "Tap twice to confirm" to avoid accidental moves.
- Build lines of your own while blocking your opponent's open threes and fours.
- The first player to make a valid five in a row wins; the winning line is highlighted.
- Use Undo to take back a move, Hint to see a suggestion, and New Game to start again with new settings.

Gomoku Strategy Tips
- Start in the centre. Central moves have room to grow in all eight directions; edge moves are easy to block.
- Know your threats. An open three (_XXX_) must be answered at once, or it becomes an open four that cannot be stopped.
- Always block a four. A four with one open end wins next move unless you play on that open end.
- Create double threats. A move that makes two open threes (3-3) or a four plus an open three (4-3) usually wins, because your opponent can only block one.
- Play connected and diagonal shapes. Stones placed diagonally or one gap apart build several potential lines at once.
- Defend with attack. The best block also extends your own lines, so you gain tempo while defending.
- Count tempo. If you have a four available, check whether a chain of fours (VCF) leads to a win before defending.
- Under the caro rule, a five pinned between two enemy marks does not count – so aim for lines with at least one open end, and sandwiching your opponent's lines is a real defence.
- As the second player, stay close to your opponent's stones and block early; the first player has a natural advantage.
- Practise against Easy and Medium, use Hint to learn typical shapes, then challenge Hard.
History of Gomoku
Five-in-a-row games are believed to have been played on Go boards in East Asia for centuries. The name gomoku comes from the Japanese gomoku narabe, "five pieces in a row", and the game became widely popular in Japan in the Meiji era, where it was played with Go stones on the 19×19 board. In 1899 the variant renju introduced restrictions for Black (no double threes, double fours or overlines) to reduce the first-player advantage, and international renju tournaments are still held today. In 1994 computer scientists proved that on a 15×15 board, freestyle gomoku is a win for the first player with perfect play. In Vietnam the game spread as cờ caro, played with X and O on squared notebook paper in school, often with the rule that a five blocked at both ends does not count.
Why Play Gomoku?
- Trains pattern recognition, planning and counting several moves ahead.
- Each game lasts only a few minutes – perfect for a short break.
- Easy to teach children and friends, yet deep enough for serious players.
- Playing against the computer improves your tactics faster than random play.
- Works offline once the page has loaded, with no account and no download.
