Skip to the game
Connected by Boards

Gomoku online

A simple first move. A beautifully tangled next one.

Lines & connections · 2 players

Pull up a chair.

Five stones in a line. A hundred ways to miss the threat.

Gomoku is a two player game of five in a row, played with black and white stones on the 225 intersections of a 15 by 15 board. You take turns placing one stone, nothing ever moves again, and the first unbroken line of five wins. Hand out a link, share one screen, or set stones against the computer.

Free to play. No account or download. Chat and optional voice in every online room.

How to play

Jade moves first. Take turns placing a stone on an empty intersection of the 15 × 15 board.

Connect five or more stones horizontally, vertically or diagonally to win. This is freestyle Gomoku: longer lines also count, and there are no forbidden-move restrictions. A full board without a winner is a draw.

The rules on this table

Jade opens. The convention the game itself uses is black first and white second, and the two seats here are Jade and Ivory in that order. After that you alternate, one stone a turn, on any empty intersection you like. Gomoku is played on the crossings of the grid rather than inside its squares, and once a stone is down it never moves and never comes off, so the board only fills.

The first unbroken line of five ends it, whether it runs horizontally, vertically or diagonally. So does six, and so does seven, because this board plays free-style gomoku and an overline counts here. Every professional rule set says the opposite, that six in a row is not a win, so the version on this table is not the version most writing about gomoku describes. If all 225 intersections fill with no five anywhere, the game is drawn, and either of you can resign at any point.

What this board leaves out is the balancing machinery. There are no forbidden moves, so the double three and the double four that renju takes off black are legal here for both of you. There is no swap, no Swap2, no Pro rule and no opening restriction of any kind. That is free-style gomoku, the version most people know from paper, and it is the version with the first player’s advantage still in it. What that means for whoever goes second has a section of its own below.

Five stones in a line, and 572 ways to make one

Because the stones stay where they are put, this is a board game you can play without a board. Squared paper does the job, and that is where most people meet it first, with two pens and a school notebook. The Czech federation for the game still carries the paper version’s own word, piskvorky, in its name.

We counted the lines that fit on ours. A row of fifteen holds eleven different straight fives, so fifteen rows give 165 across and the columns give another 165. The diagonals running each way give 121 apiece, which is 242. That is 572 places a game can end, and every one of them is a way to win and a way to lose.

Fifteen by fifteen is not the only size the game has had. It was played on the 19 by 19 go board first, and the smaller grid became standard for gomoku later, which is why omok in Korea still looks like the older arrangement. Fifteen squared is 225 intersections, and that is also the ceiling on a game here: no game on this board can outrun 225 stones, because after that there is nowhere to put the next one.

Go, moku, narabe

The name is Japanese. Gomokunarabe is written 五目並べ: go is five, moku is the counter word for pieces, and narabe means lining up. Five pieces, lined up. Historical records put the game in the Edo period, in the middle decades of the 1700s, and by around 1850 books about it were being published. The earliest one anybody can point to is the Gomoku Joseki Collection of 1856.

The same game is played across east Asia under names built the same way. In China it is wuziqi, 五子棋, where wu is five and zi is piece. In Korea it is omok, 오목, from the same two characters as the Japanese name. So the answer to whether it is Chinese, Japanese or Korean is that the game is old enough and simple enough to be all three, and that the name we use here, and the fifteen by fifteen board, came from Japan.

In nineteenth century Britain it was known as Go Bang. Where that spelling came from is reported rather than proved: goban is the Japanese word for a go board, and Go Bang is said to be that word mangled on the way over. What is attested is the Oxford English Dictionary’s citation of 1886, with its note that the game had lately arrived in England under a misspelt name. In the 1920s Chad Valley sold a modified version in a box called Spoil Five.

Gomoku is solved, and black is the one who wins

Free-style gomoku on a 15 by 15 board is a first player win. Not thought to be, not probably: proved.

L. Victor Allis proved it, using proof-number search and dependency-based search, in his 1994 thesis at the University of Limburg, building on the paper Go-moku and Threat-Space Search that he wrote with H. J. van den Herik and M. P. H. Huntjens in 1993. Starting from an empty grid, black holds a strategy that beats every defence white can play. It holds for free-style gomoku and for standard gomoku without any opening rule, and the same is thought to hold on larger grids.

That proof came out of a search, which changes what it is worth. The win was found by a program working the position out, so the strategy is a line a machine can be made to play rather than a promise that something exists somewhere. Renju, the restricted version described below, went the same way in 2001, when J. Wagner and I. Virag showed Allis’s result carries over to it when the opening is unrestricted.

A settled result sounds like a reason not to sit down, and it is not one. The line runs dozens of moves deep in forced replies and it took a program to find, so no known human plays it from memory. What the proof actually did was change the sport rather than end it: every opening protocol in the next section exists because free-style black is too strong, and not one of those protocols has been solved.

Nor is the game easy to compute in general. Stefan Reisch proved in 1980 that gomoku generalised to boards of any size is PSPACE-complete. Two facts sit side by side: the standard board is settled, and the tournament game built on top of it is not.

What the championships do about black

Competitive play has gone at black’s advantage from two directions since the end of the nineteenth century: restrict what black is allowed to build, or take the opening out of black’s hands.

The world championships of 1989 and 1991 used the Pro opening rule. Black’s first stone must go in the centre, white answers anywhere, and black’s second stone must leave three empty intersections between itself and the first. Over those two championships black still won 67 per cent of the games. That was judged too lopsided to keep, and from 2009 tournament gomoku has opened with Swap2 instead. One player lays out three stones, two black and one white, and the other chooses: take white and add a stone, take black as it stands, or add two more stones and hand the colour choice back. Under Swap2 black’s share of the wins falls to about 52 per cent.

Renju goes at the same problem from the other end, by forbidding black what white may still do. Three and three is banned, so black may not play a move that opens two threes at once. Four and four is banned. An overline does not win for black and loses him the game outright. Renju then stacks a certified opening rule on top, and Soosorv-8 is the current international standard.

Going second on a board with no swap

The theory says the person going second is behind before a stone is down. It does not say they are lost. Converting a proved first player win takes that forcing sequence read many moves deep, which is a skill, and below that level the game turns on who spots an open three first. Free-style hands the second player something back as well: the double three, the double four and the winning overline that renju takes off black are Ivory’s here as much as Jade’s, because this table takes them off nobody.

If you want the balance the sport uses, one of its two rules can be run here by agreement and the other cannot. The Pro rule can. It only says where black may put stones, and every intersection on this board is legal, so the two of you can simply hold to it between yourselves. What that buys is what it bought the championships: black on 67 per cent, which is narrower rather than level. Swap2 cannot be done by hand here at all, because it needs three stones on the board before either colour is settled, and this table alternates from the first stone and hands the colours out by seat.

Threes, fours, and the move that makes two threats

Gomoku strategy is counting. What you count is the number of ways a line could still be finished, and what you watch is the open ends that keep those ways available.

A three with both ends open has to be answered at once. Left standing for a turn it becomes a four with two open ends, and a four with two open ends wins on the following move whichever end is blocked, because blocking one end leaves the other. Leaving one standing for a turn is the classic way to lose this game. A four with one end already blocked threatens a single point, so it can be stopped, but it still forces a reply and buys a free move somewhere else.

Then comes the move the rest of it is built towards: one stone that makes two threats at the same time. Two open threes crossing on the stone you have this moment played cannot both be answered, because your opponent has one move and you have two ways through. Strong players get there by chaining forced replies, and experts read forcing sequences of twenty to forty moves at speed, which is the part a beginner never sees coming.

Defence is the same counting done in the other direction. Before you build, look at what your opponent’s last stone did to the open ends near it. Somebody who only ever answers the threat in front of them loses to the fork every time.

The computer on this board

The opponent here is a one turn evaluator. It looks at every empty intersection and scores it twice: once for the line it would make for itself, and once for the line you would make if you took that point instead, the second weighted a shade lower than the first. Five in a row scores above everything, then a four with both ends open, then a blocked four, then an open three, and so on down to a lone stone. It plays the highest total.

Two things it will always do, and our own test holds it to both. It takes a five when one is on offer. When it has none, it blocks a point that would hand you five.

On an empty grid it opens on the centre point, whichever seat it holds, and the reason is smaller than it looks. A lone stone scores by the open line ends it touches, which comes to eight at every one of the 169 intersections off the rim, so 169 points tie for first place. What separates them is a small penalty subtracted for distance from the middle of the board, and the middle is the only point that pays none of it.

It does not simply block, and the quickest way to see that is to build a column beside its column. We played it out. It opened on the centre, we answered alongside it, and by our third stone we held three in a column with both ends open. It did not block. It completed its own four, open at both ends, because an open four beats an open three by exactly one move. We blocked one end, it took the other, and it had five nine stones into the game.

What it has no answer to is two threats at once. It never looks at your reply, so it takes whichever single threat scores higher and the other one goes through. We played that out as well. Three stones across and three on a diagonal, crossing on the stone we had just put down: it blocked the diagonal, the row ran out to a four open at both ends, it blocked one end, and the stone after that was the fifth.

It is also why two of them can draw with each other. Set one against another from an empty grid and they fill all 225 intersections with neither side ever landing a five, because each blocks what the other builds and neither builds anything that needs two moves to arrive. That is a measurement of this opponent and not of the game. How often two people draw is something we have not counted.

It has no difficulty levels, because we have not built any. Every board here carries a computer opponent for a second reason as well: it is how the person who keeps these games plays each one before it goes up, and gomoku was tested that way.

Renju, omok, caro, and the family next door

Renju is the best known relative, the professional version with the forbidden moves, and it got its name from a journalist. Ruikou Kuroiwa called it renju in the newspaper Yorozu Chouhou on 6 December 1899. The word means connected pearls.

The others each change one rule. Omok, in Korea, is played on the bigger 19 by 19 grid and bans the double three. Caro, played in Vietnam, counts a five only when it is not blocked at either end, which hands a great deal back to the defender. Ninuki-renju and Pente add capturing: sandwich a pair of your opponent’s stones and they come off the board, and five pairs taken wins outright, which turns a game where nothing is ever removed into one where things are.

The whole family is one idea with the numbers changed. Mathematicians call these m,n,k games: a board m by n, and k in a row to win. Gomoku is (15,15,5). Four in a Row is (7,6,4), with the extra rule that a disc falls to the lowest free space in its column, and there is a board for that one here too. Connect6 asks for six and hands out two stones a turn after a single opening stone, so both sides have the same number down at the start of every turn.

The app, the bot, and the local game

There is no gomoku online app to install, and none is needed, because the grid is a web page. A phone gets the board a laptop gets, there is nothing to download, and there is no version to keep up to date.

A gomoku online bot is what most people mean by the computer opponent, and this one has its own section above. The short of it is that it never misses a five and it can be forked.

The local game is the one where gomoku online does not have to mean online. Two people sitting together share a single screen and turn it between moves, with no link sent and no second device asked for, and the board keeps track of whose turn it is so neither of you has to.

Playing gomoku online with friends

A table is one click away, and it comes with a link. Whoever you hand that to is holding the other colour by the time the page has loaded, with no sign-up standing between them and the first stone. Friends at opposite ends of a country get the board that two people at the same table get.

Gomoku is here because nobody owns it. The shelf is built out of games that stayed free for anyone to set out: draw them properly, keep a seat open on each, and two people a long way apart have something to sit down to. Anyone who used to enjoy the paper version has nothing new to learn here, and somebody far away to lose to.

None of the rest has to be learned first. Jade opens, five in a line wins, six wins as well, and the rest of it arrives on the board while you play, which is how it was handed over across a notebook in the first place.

Questions people ask

How do I play Gomoku online?

Open the board and start placing stones. A link makes a private table for a friend anywhere, one screen works for two people in the same room, and the computer will take a seat if nobody else can. No account is asked for, and nothing is installed. Jade opens and five in a line wins.

Is there a Gomoku AI to play against?

Yes, and it is a one turn evaluator rather than a searcher. It opens on the centre point, never misses a five, and blocks yours. It weighs its own line against yours on every empty intersection, but it never looks at your reply, so two open threes crossing on one stone will beat it.

Is Gomoku a Chinese game?

It is played across east Asia and China has a strong claim. The Chinese name is wuziqi: wu is five, zi is piece, and qi marks a board game. The version the world knows as gomoku, on a fifteen by fifteen board, is the Japanese one, recorded in the Edo period and published in 1856.

Has Gomoku been solved?

Yes. L. Victor Allis proved in 1994 that on an empty 15 by 15 board the first player can force a win in free-style gomoku, using proof-number search and dependency-based search. Renju followed in 2001. The modern tournament openings, Swap2 among them, have not been solved, so the competitive game is still open.

Is Gomoku a Korean game?

Korea plays it as omok, usually on a nineteen by nineteen grid and with the double three banned. The name comes from the same two characters as the Japanese gomoku and means the same thing, five points. So omok is Korean, gomoku is Japanese, and underneath both is the same line of five stones.

Will chess ever be fully solved?

Nobody knows, and nothing at the scale of chess has been solved yet. Checkers fell in 2007 and is a draw with best play, and gomoku fell in 1994 and is a first player win. Chess has far more positions than either, so the honest answer is that it is out of reach with what anybody can build today.