How to Win Connect 4 Every Time, According to the Computer Scientist Who Solved It
Ready to discover new expert-approved Connect 4 strategies? Learn how to win Connect 4 and conquer your opponent every time.
Since 1974, the board game Connect 4 has been delighting people of all ages. While Hasbro bills it as fun for ages 6 and up, winning Connect 4 is by no means mere child’s play. Sure, school-age kids have been keeping this classic board game flying off the shelves for 50 years, but it is a mind-bender of a game. So much so that how to win Connect 4 was the topic of Dutch computer scientist Victor Allis’s master’s thesis. In fact, he’s credited with literally solving the game in 1988.
“What is beautiful about Connect 4 is that [while it’s not simple], it’s not so complicated that it’s difficult to learn,” says Allis. “You can play many, many times and still be discovering new strategies.”
Connect 4 has been a cultural phenomenon for decades, with life-size versions available for pub, office and backyard play, as well as online versions that challenge those who are “game” to attempt the near impossible—beating AI. To get the inside scoop on how to always win Connect 4 (or at least most of the time), we got tips from Allis and other leading experts on strategy games. So if you prefer to compete in (and win at) games for two people, you’ve come to the right place. Here’s what you need to know.
Get Reader’s Digest’s Read Up newsletter for knowledge, humor, cleaning, travel, tech and fun facts all week long.
How to play Connect 4
Connect 4 is all about lining stuff up in a row. If you already know how to win tic-tac-toe, then consider yourself ahead of the curve. But whereas tic-tac-toe is played on a tiny grid consisting of three rows and three columns, Connect 4 is played on a grid made up of six rows and seven columns—with a total of 42 possible spots. The upshot is that there are more than 4.5 trillion ways for the grid to be completed (4,531,985,219,092, to be exact). Fortunately, there are around 2 trillion ways to win as well, which makes the game not only super fun and compelling, but also mildly addictive for competitive folks.
To play, two people take turns dropping checkers into the Connect 4 slots, attempting to make a horizontal, vertical or diagonal line of four checkers of your own color. You can also use your checkers to block your opponent’s attempt at four connections. But what does it take to actually hit a winning combination (while playing a focused opponent with a few tricks up their own sleeve)? Intense strategy, not unlike learning how to win Monopoly.
What are the best strategies to win Connect 4?
Mastering how to win Connect 4 boils down to two options. One is playing again and again—as both the first and the second player—to learn the best strategies. The other option, a slight shortcut, is going into the game armed with the strategies discussed below. While none can guarantee a win every time, as Allis notes, “there are definitely some rules of thumb that can help.”
1. Be “player one”
The simplest Connect 4 strategy is simply going first. “Going first means you can dictate the play,” says Keith Galli, a Connect 4 expert who earned his masters in computer science at Massachusetts Institute of Technology and has devoted considerable time to teaching a large audience on YouTube his favorite winning Connect 4 strategies.
Because players take alternate turns, and forfeiting a turn is not an option, order matters. In fact, as Allis proved in his thesis, player one is guaranteed a win—provided they play a perfect game. Playing a “perfect” game refers to always dropping your playing piece into a spot that not only creates an advantage for you but also eliminates (or zeros out) whatever advantage the other player may have gained via their last move. It’s a tall order, our experts agree. And in the average game involving two average players, it’s just as likely the second player wins. But using strategy increases the chances of playing a perfect game.
2. Start in the middle of the bottom row
If you’re player one, the perfect first play is to place your first piece in the middle spot of the bottom row (in Connect 4 parlance, that’s known as “D1”). Indeed, it is the only surefire, guaranteed way to win—provided that you continue to play a perfect game. The number of spots on a Connect 4 grid is finite (i.e., 42), and the number of ways to win is finite as well (albeit large). A checker in D1 allows you to make a Connect 4 in all possible directions, which makes it the best possible first move.
In fact, for player one, starting at D1 is critical. If the second player can manage to play a perfect game, then the first player cannot win unless they began the game by taking D1, Allis says.
3. Focus on the middle column
Generally speaking, either player can improve their odds of winning by loading up the middle column with their own pieces, says Galli. With seven columns and six rows within which to create a line of four, all horizontal lines of four will end up having a playing piece located in the middle column. Since horizontal is one of the three directions in which a line of four may be created, the laws of probability make it difficult to envision winning without controlling the middle. Exceptions do apply, however.
4. Make a strategic second move
If you’re player one and have played the perfect first move at D1, then your opponent’s first move will likely be to place a piece directly above—in a reasonable attempt to block you vertically up the middle, says Allis. If that is the case, your instinct as player one might be to place your second piece right above that one. Instead, Galli suggests a more strategic alternative, which is placing your next piece in the farthest left-hand or farthest right-hand column. “As the grid builds up,” Galli explains, “you’ll be giving yourself an opportunity to create a diagonal four-in-a-row.”
5. React appropriately as player two
As noted above, if player one places their first piece at D1, player two will often place theirs directly above D1. If you’re player two, however, you’re better off resisting the impulse to do so and instead, making your first move at one of the two spots directly next to D1. According to Allis, this strategy stands a good chance of enticing player one to place their own piece directly above D1 (a reasonable attempt to gain control of the middle column). In that case, your response should be to place your second piece directly above that. Doing so may not result in a win, notes Allis, but it levels the playing field enough that a tie will be possible.
6. Play the odd rows
Also known as the parity strategy, “playing the odd rows” is when the first player aims to secure three pieces in a line so that an empty fourth spot is in one of the odd-numbered rows (the first, third or fifth from the bottom). That line can be horizontal, vertical or diagonal. Galli says that this is not only his favorite how-to-win Connect 4 strategy but also the one that is talked about least on social media—thus making it all the more powerful for those in the know.
Given the finite number of positions on the grid, and assuming perfect play, this strategy should have the effect of leaving one of the columns “either free or nearly free” by the 37th move of the game, Galli notes. This will have the effect of forcing the second player to place their piece in the last spot before the first player’s winning spot.
7. If you’re player two, play the even rows
The parity strategy discussed above works for the second player as well, except that the second player must set up their three-in-line in an even row, Galli points out. Of course, while setting things up as such, “you still have to make sure you’re not ignoring some other risk.” In other words, even as you play offensively, it’s still important to play defensively, eliminating any advantage gained by the first player in an earlier move. This, of course, applies to the odd-parity play as well.
8. Fork your threats
In Connect 4 parlance, whenever three playing pieces are lined up adjacently, it’s called a “major threat,” even if it might take several moves to complete the line-of-four (due to the vertical nature of the columns). An “adjacent threat pair” refers to two major threats that are connected by at least one playing piece. And forming an adjacent threat pair—also known as “forking your threats”—is one key to a quicker win than you may achieve using the parity strategy, says Galli.
Galli’s preferred fork is known by many as the “figure 7 trap” because the player making use of it creates a seven-shaped formation of their playing pieces. This involves three pieces in a diagonal line, where the top piece is also part of a three-piece horizontal line. If executed in the center of the board, in any orientation, this offers multiple opportunities for a win, and that can be difficult, if not impossible, for the other player to block. As you play more, you’re likely to pick up on other forks as they arise organically, Allis notes.
9. Observe carefully and think ahead
As you’ve probably gleaned by now, watching the grid carefully as it builds up is critical to winning Connect 4 because four-in-a-row can occur in any direction, and the threats build up quickly. As discussed above, playing a “perfect” game requires defending against all threats made by your opponent. These include major threats, as well as minor threats. Minor threats are two pieces in a row when there is a third piece that would be in line if it weren’t for an empty spot in between. Thinking ahead, you would want to close up that empty spot immediately.
Likewise, if your opponent has set up two pieces in a row with a space on either side, thinking ahead would tell you to block them on one side—otherwise, your opponent will be assured a win by placing a piece on either side, creating a line of three. In that case, on your next turn, you’ll be able to defend only against one side, leading to your loss.
10. Assume your opponent knows as much as you do
Mastering a Connect 4 win requires the assumption that your opponent knows all the strategies you know (if not more). Before placing your next piece, always consider what your opponent would do in response, and you’ll want to assume that they’re playing optimally. Doing so can help avoid making mistakes that might have you face-palming.
What is the fastest way to win Connect 4?
According to Galli, there’s no faster way to win Connect 4 than to place three tiles next to one another in the bottom row. As noted above, this leaves your opponent with the ability to block only one of the two possible four-in-a-rows that you’ve set up, leading to their loss within two moves. Losing in the bottom row is a potential rookie mistake, but it can happen to anyone, no matter their expertise. As Galli points out, anyone can be caught off-guard if they’re not giving their full attention to the game.
Is it possible for no one to win Connect 4?
Just as it is possible for no player to win tic-tac-toe, it is also possible that no one wins a game of Connect 4. This situation is known as a “draw.” Not only did Allis prove the possibility of a draw in his thesis, but if you play Connect 4 enough, you’ll likely prove it for yourself in relatively short order.
Before you declare a draw though, you’ll want to be sure to study the grid carefully to make sure a line of four in a row hasn’t been created unintentionally by either player. When Connect 4 players are playing strategically, each may be so focused on creating the line they’ve strategized, it’s possible to miss a line that has been created inadvertently.
Common mistakes to avoid when playing Connect 4
As noted above, the fastest route to losing Connect 4 is allowing your opponent to place three pieces in a horizontal row. However, another common mistake is to forget to play defensively. This often happens when you focus too much on placing your pieces into whatever configuration you may have pre-envisioned. “Every time you drop a piece, make sure you’re not offering your opponent an opportunity to win before your next turn,” Galli suggests.
He also suggests avoiding placing pieces into the perimeter columns too early in the game. Finally, an easy mistake to make is aiming for a particular space without consciously registering that there’s an empty space beneath it. In many cases, that’s the penultimate move before the other player can declare victory.
Is there an algorithm for Connect 4 if you’re playing online?
It took Allis nine months to do so in 1988, but these days, it would probably take a skilled programmer less than a day to create an algorithm capable of playing a perfect game of Connect 4, he says. If you could leverage such a program, then theoretically, you could stop any opponent in their tracks by playing every move perfectly—as long as you’re player one. In every single game that’s played perfectly from start to finish, the first player will always win, Allis says. It’s simply mathematical fact.
By the same token, if you play Connect 4 online against a computer, then you will likely be doing so against a sophisticated algorithm. Even if it’s not sophisticated enough to anticipate every perfect move, it’s very likely that the computer will emerge the victor. Of course, you still have a chance if you happen to be the first player.
About the experts
- Victor Allis earned his PhD in artificial intelligence from Vrije Universiteit Amsterdam. In 1988, during the course of his studies, he solved Connect 4 (the topic of his master’s thesis) as well as two other games, leading to their retirement as games eligible for the Computer Olympiad. Today, Allis is devoted to furthering the efforts of ActiVote, which he founded with two others to find ways to get more people in the U.S. to vote.
- Keith Galli earned both his bachelor’s and master’s degrees in computer science from Massachusetts Institute of Technology (MIT). A mathematically driven guy from his earliest days, he’s pretty much hacked the game of Connect 4 and instructs players on how to win via his YouTube channel.
- Hasbro: “The Classic Game of Connect 4”
- Cornell University: “Solving Connect 4 with Game Theory”
- Victor Allis: Master’s Thesis (1988): “A Knowledge-based Approach of Connect-Four, The Game is Solved: White Wins”
- Stack Exchange: “Can Humans Play Connect 4 Perfectly?”
- Keith Galli: “The Best Strategy to Win at Connect 4! (Odd Even Strategy)”
- Noah Kaczor: “How to Win Connect 4 – Figure 7 trap”
- 2Swap: “Threat Pairs: Connect 4 Strategy”
- Cool Math Games: “Four in a Row”
- Family Gamer Guide: “Can You Tie Connect 4? (Is It Allowed?)”