Skip to content

How to Win the Snake Game (and Fill the Whole Board)

By the NitroPlayer team · Updated · 5 min read

You win the Snake game by filling the whole board, and the safe way to get there is to hug the walls, keep the middle open and always leave a path back to your own tail, because the tail keeps moving out of the way. On the NitroPlayer 20x20 board a perfect game is 397 apples and 3,970 points.

The Snake Trick for a Really Long Snake (44 seconds, recorded in our free Snake game). Read the transcript.

Key points

  • Hug the walls: travel along the edges and your own body, not through the middle.
  • Keep an exit: before each turn, make sure you can still reach your tail.
  • The tail is safe: moving into the cell your tail is leaving does not end the run.
  • A full-board loop never loses: in our 1,000 simulated runs it filled the board every time, in about 46 minutes on average.
  • Chasing apples by the shortest path crashed after about 75 apples on average in our test, and never filled the board.

Play Snake freeNo download, no sign-up. Play solo, online or with a friend.

What winning means in Snake

Snake has no last level. The run ends when you hit a wall or your own body, so "winning" means one of two things: beating your best score, or the perfect game where the snake fills every cell.

The NitroPlayer Snake game uses a walled board of 20 x 20 = 400 cells. You start 3 segments long, and every apple adds one segment and 10 points. So a full board takes 397 apples, for a maximum score of 3,970. Every apple also makes the snake a little faster: one step every 150 ms at the start, 2 ms quicker per apple, until the top speed of one step every 60 ms after 45 apples.

The snake trick from the video: hug the walls

For the clip we set up a snake that was already 24 segments long, lying along the top and left walls, so the score (210) and speed match a real run at that point. From there it follows three rules:

  1. Hug the walls. Glide along the edges, and later along your own body, instead of cutting through the middle.
  2. Keep the middle open. A big empty area in the center means you always have room to turn.
  3. Leave yourself an exit before every turn. As long as you can still reach your own tail, you are safe.

Why the tail? Every step the tail moves away, unless you just ate. The game even lets your head enter the cell the tail is leaving that same step. So if there is a path from your head to your tail, you can always follow it and wait for a better moment.

We simulated 1,000 perfect games

To see what a guaranteed win looks like, we wrote a short script with the game's own rules: the 20 x 20 board, the starting snake, random apples and the real speed curve. Then we compared two ways of playing.

StrategyRunsApples eaten (avg)Full board
Shortest path to every apple50075 (best 137)0 times
Fixed loop through all 400 cells1,000397Every time

The loop is simple: zigzag along the rows, one row right, the next row left, and use the left wall column as the way back to the top. Because the loop visits every cell once before it repeats, the head can never catch the body. The price is time: the loop needed about 39,700 steps on average, roughly 46 minutes of play (between 40 and 52 minutes), and it took about 16 minutes just to eat the first 50 apples.

Real players sit between these two: take shortcuts while the snake is short, and switch to tidy lanes as it grows.

Snake game strategy by length

  • Short snake (under about 40 segments): go straight for the apples. You have lots of room, and the slow early speed gives you time for clean turns.
  • Medium snake: start sweeping in rows along one wall. Back-and-forth lanes keep the body tidy and the gaps predictable.
  • Long snake (100+ segments): the body now covers a quarter of the board. Before eating, check that you will not be sealed into a pocket. A space with fewer free cells than your length is a trap.
  • Very long snake: stop taking shortcuts. Follow your loop or your tail and let the apples come to your path.

Control tips that save runs

  • One turn per step. The snake reads one direction per step. If you press two keys inside the same step, only one of them counts, so space out quick double turns.
  • You cannot reverse. Pressing the opposite direction is ignored. To turn back, make two quarter turns with a free lane beside you.
  • Turn less at top speed. At 60 ms per step the snake moves about 17 cells per second. Fewer, planned turns beat frantic zigzags.
  • Pause before a tight spot. In solo play, P or Esc pauses with no penalty. Switching tabs pauses too.
  • On a phone, short swipes on the board turn the snake.

Snake Race: a different way to win

In a 2-minute Snake Race both players get the same apples in the same order, and the higher score wins. A crash stops your run but keeps your points. With only 120 seconds, a full board is impossible, so the plan changes: eat fast while the snake is short, and only slow down when a crash would hand your rival the lead. Play online or send a private link to a friend.

Frequently asked questions

Can you actually win the Snake game?

Yes, by filling every cell of the board. On NitroPlayer that means 397 apples and 3,970 points. A route that loops through every cell guarantees it, but in our simulations it took around 46 minutes of play.

What is the best Snake game strategy?

Hug the walls, keep the middle of the board open and always keep a path back to your tail. Take quick routes to apples while the snake is short, then switch to tidy back-and-forth lanes as it grows.

Why is following your tail safe?

Your tail moves out of its cell on every step where you do not eat, and the game lets your head enter that cell on the same step. As long as your head can reach your tail, you always have a way out.

What is a good score in Snake?

Each apple is worth 10 points. In our test, a script that always took the shortest path to the apple crashed after about 75 apples, or 750 points, on average, so a planned run that passes 750 is doing better than pure apple chasing. The perfect score on the 20x20 board is 3,970.

Video transcript

Want a really long snake? Try this simple trick.

Hug the walls. Glide along the edges, not through the middle.

That keeps the middle open, so you always have room to turn.

Before every turn, make sure you leave yourself an exit.

As long as you can still reach your own tail, you're safe.

Stay calm, and watch it grow. So satisfying!

Now you try! And on NitroPlayer, you can play with your friends. Games are so much more fun together.

Play free at NitroPlayer dot com.

Try it now: play Snake