Gomoku: five in a row on a wooden board

Take turns placing black and white stones. The first to line up five wins.

  • Board games
  • 15×15 or 19×19 · Freestyle or Standard rules · vs computer (3 levels) · 2 players
  • Free

Loading puzzle…

Gomoku, free online

Gomoku is a two-player strategy game played with black and white stones on the lines of a board. You take turns placing one stone, and the first player to make five in a row wins. The rules take ten seconds to learn, but the game rewards careful reading, a lot like chess tactics.

Here you can play the computer on easy, medium or hard, or choose 2 players and share one phone or computer with a friend. Pick the classic 15×15 board or a full 19×19 go board, and Freestyle or Standard rules. The board is drawn as a wooden goban, stones land with a small bounce, and the winning five lights up when the game ends.

How to play here

Click or tap where two lines cross. You don’t have to hit the exact spot: the nearest point is used. With a mouse, a see-through stone shows where your stone will go. On a phone, where the points sit close together, your first tap shows the stone with a magnifier and a crosshair so you can check the spot, and a second tap on the same point places it. Tap a different point to move the aim.

The chips at the top show who is playing which colour, how many games each side has won in this visit, and the move count. The chip of the player whose turn it is lights up. A red dot marks the last stone played, so you never miss the computer’s reply.

Undo takes back your last move, together with the computer’s answer. Hint asks the hard computer for its choice and marks that point with a gold ring. Restart deals a fresh board with the same settings, and the pause menu lets you change the board, rules or level.

Freestyle or Standard

In Freestyle gomoku any line of five or more stones wins. In Standard gomoku you need exactly five: a line of six, called an overline, does not count, and the game goes on. The difference matters most in close fights, where filling one gap would join two of your lines into six. If that happens in Standard, the status line tells you the overline did not count.

A short history

Five-in-a-row games have been played in East Asia for centuries. The form we know as gomoku comes from Japan, where it was played on a go board with go stones and became popular in the late 1800s. It reached Europe and America under the name gobang, and today it is played everywhere, from paper grids in school to world championships. Players who wanted a fairer game for White developed renju, which limits what Black may do.

Strategy that works

  1. Play in the middle. Early stones near the centre take part in more lines than stones on the edge.
  2. Know your shapes. Two in a row with open ends is a start. An open three is a threat. A four must be blocked at once. An open four cannot be stopped.
  3. Answer threats in order. First win if you can. Then block a four. Then make your own four if it helps, or block an open three.
  4. Count broken threes too. A shape like stone, gap, stone, stone with open ends is just as dangerous as three in a row, and it is easier to miss.
  5. Look for crossings. The four-three fork and the double open three both come from one stone that lies on two of your lines. Place stones so your lines cross at empty points you can use later.
  6. Keep the initiative. Every four you make forces a reply. Several fours in a row can carry you straight into a winning shape, a trick strong players call a victory by continuous fours.

Levels

Easy is for learning: it blocks a four but often lets an open three slip. Medium blocks open threes and spots simple forks. Hard searches several moves ahead and plays sharp attacks, so you need forks of your own to beat it. Black has the first-move advantage, and colours switch every game, so try to win as White too. For more two-player games, try Four in a Row, Reversi and Dots and Boxes.

How to play Gomoku

  1. The board starts empty. Black places the first stone, then the players take turns placing one stone on any empty point where two lines cross.
  2. Stones never move and are never taken off the board.
  3. The first player to get five stones of their colour in an unbroken line wins. The line can run across, down or diagonally.
  4. Freestyle rules count five or more in a row. Standard rules need exactly five, so a line of six or more does not win.
  5. If the board fills up and nobody has five, the game is a draw.
  6. Against the computer you play Black in the first game, and the colours switch every game.

Gomoku tips

Start near the centre

A stone in the middle can join lines in every direction. Stones near the edge have less room to grow, so keep your early moves close to the centre and close to your own stones.

Block open threes at once

Three in a row with both ends empty is an open three. If you leave it, your opponent turns it into an open four, which has two winning ends, and you can only block one. Block an open three on the very next move unless you can make a four yourself.

Build a four-three fork

The classic winning move makes a four and an open three at the same time. Your opponent has to block the four, and then your three becomes an open four. Look for points where two of your lines cross.

Make moves that do two jobs

The best defensive stone also extends one of your own lines. Blocking with a stone that builds nothing hands your opponent the initiative.

Frequently asked questions

How do you win at gomoku?

Get five stones in a row before your opponent does. In practice, games are won with double threats. An open four (four in a row with both ends free) or a four and an open three made with the same stone leaves the other player unable to block everything. Keep the initiative by making threats your opponent must answer.

Is gomoku solved?

Yes, for the usual board. In the early 1990s Victor Allis and his colleagues used computer search to prove that on a 15×15 board, Black wins with perfect play in freestyle gomoku, and also in the version that needs exactly five. The winning lines are long and hard to remember, so the game is still a real contest between people.

What is the difference between gomoku and renju?

Renju is gomoku with rules that slow Black down, because Black has a big advantage. In renju Black may not make a double three, a double four or a line of six or more, while White may. Renju also uses fixed opening rules agreed in tournament play. Gomoku keeps the simple rules, which is what you play here.

Is gomoku the same as gobang or five in a row?

Yes. Gomoku comes from the Japanese name gomoku narabe, which means five pieces in a row. Gobang is an older English name taken from goban, the Japanese word for the board. Many people simply call it five in a row.

How strong is the computer?

Easy plays loosely and sometimes misses an open three, so it is a good place to learn. Medium looks two moves ahead and blocks your threats. Hard looks four to six moves ahead, never misses a five or a block, and punishes loose play.

What do the board sizes and rules change?

The 15×15 board is the standard size for gomoku. The 19×19 board is a full go board with more room, so games run longer. Freestyle lets a line of six or more win; Standard counts only exactly five.