Snake game rules

How the snake moves and turns, what an apple does, what ends a run, how a duel between two snakes is won, the head-on rule, and what No walls, Maze, Speed-up and Kids change.

Updated 9 min read

Play Snake nowFree for 1–2 players on one device or against the computer, even offline. Or play Snake online with friends.Play Snake

Snake is a game about a line that grows. You steer a snake around a grid of cells; it moves by itself, one cell at a time, and every apple it eats makes it one cell longer. Hit the edge of the board, a wall or a body, your own included, and the run is over. This guide gives every rule as the snake game on this site plays it: the classic solo run, the duel between two snakes on one screen, and the five modes.

Overview

Feature Details
Players 1, or 2 at the same time (with a friend or against the computer)
Typical time 1 to 5 minutes a run; a duel to 3 rounds takes a few minutes
Board A square grid: Small 14 by 14, Medium 20 by 20 (the default) or Large 26 by 26
Goal, alone Eat as many apples as you can before you crash
Goal, two snakes Be the last snake moving, round after round
Modes Classic, No walls, Maze, Speed-up, Kids

The board and the snake

A Snake board in Maze mode: a green snake seven cells long, its head and tail, a red apple and grey wall blocks

The Small board in Maze mode. The snake’s head, with its eyes, leads; its body follows cell by cell to the tail. The grey blocks are the maze’s walls.

The board is a square grid of cells. A snake fills a chain of cells: the head, which has eyes and points where the snake is going, and the body behind it, ending in the tail. Every snake starts 4 cells long, a little way in from the edge, heading away from its player. Alone you start near the bottom left heading up; with two snakes, the second starts in the opposite corner heading down, so each is the other turned half round.

Apples sit on free cells. Alone there is one apple on the board at a time; with two snakes there are three (two in Maze mode).

How the snake moves

The snake never stops. On every tick it moves one cell in the direction its head is pointing, and the body follows: each cell of the body moves into the cell in front of it, and the tail leaves the cell it was on.

You choose only where it turns:

  • Press a direction (an arrow key or W A S D) or swipe that way on the board, and the head turns that way on its next move.
  • On a touch screen you can also press the direction pad under the board: its arrows are directions on the screen, like the keys. Or switch on Turn buttons in the ⋯ menu: two buttons that are relative, the left one turning the snake to its own left, the right one to its own right, whichever way it is heading.
  • Playing alone, the snake waits after the countdown until you press or swipe your first direction.
  • A press in the direction the snake came from is ignored, because the head would hit its own neck. So is a press in the direction it is already going.
  • Two quick presses are both kept. If you press Down and then Left within a single tick, the snake turns down on the next move and left on the move after. A third press in the same tick is dropped. This queue of two is what lets you make a tight U-turn.

The snake turns only when it moves, so a press always takes effect on the next move, never in the middle of one.

Apples and growing

When the head moves onto an apple, the snake eats it. On that move the tail stays where it is, so the snake is one cell longer from then on, and you score a point. A new apple appears at once on a random free cell: never on a snake, never on a wall, and in Maze mode never in a dead-end pocket if there is anywhere else to put it.

There is no limit on how long a snake can grow except the board itself. If a snake fills the whole board so that no free cell is left for the next apple, the run ends there with Board full: on the Medium board that takes 396 apples.

What ends a run

After every move, the game checks where each head has landed. A snake crashes if its head:

  • went off the board (in Classic, Maze and Speed-up; in No walls and Kids the edges are joined),
  • landed on a wall in Maze mode,
  • landed on any snake’s body, its own or another’s.

One case is not a crash: the cell a tail is leaving on the same move. Because every snake moves at once, a head may follow its own tail round in a tight loop, or slip into the cell another snake’s tail has just left. The exception has an exception: a snake that is eating an apple on that move keeps its tail where it was, so that cell is still taken.

Alone, a crash ends the run. Your score is the number of apples you ate, and the game keeps your best score in each mode on your device.

Two snakes

With two players, both snakes move at the same time on the same board. There are no turns to take and nobody waits: each player steers their own snake, and the computer can steer the second one.

A match is played in rounds. Each round starts with a countdown, both snakes back at their starting corners and fresh apples on the board. A round ends when a snake crashes, and the last snake still moving wins it. If both crash on the same move, nobody gets the round. The first player to win 3 rounds wins the match, or 5 if you pick that under More options. Apples make a snake longer, and length matters when two heads meet.

Head-on crashes

When both heads move onto the same cell, or the two heads swap places (each moving into the cell the other’s head just left), it is a head-on crash. The rule is simple: the longer snake survives and the shorter one crashes. Length is counted before the move. If the snakes are the same length, both crash and nobody takes the round.

Step through a head-on crash

Step 1 of 3: Green, five cells long, and Blue, four cells long, run at each other along one row.

So eating apples is not only about the score in a duel. A longer snake can drive at a shorter one’s head without fear, and the shorter one has to give way.

When a round runs long

If both snakes are still moving 3 minutes into a round, the round ends there and the longer snake wins it. Equal lengths: nobody gets the round.

The modes

Pick the mode in the setup before you start. The rules above are Classic; each other mode changes one thing.

No walls

The edges of the board are joined. A head that goes off the right edge comes back on at the left edge, in the same row; off the top, back in at the bottom. Only bodies can end a run.

Snake in No walls mode: a green snake goes off the right edge and comes back on at the left edge of the same row

No walls: the head has gone out at the right edge and come back in at the left, in the same row. The rest of the body follows it across.

Maze

The edges are solid, as in Classic, and six bars of wall stand inside the board. The maze is the same when turned half round, so with two snakes neither starting corner is easier. Only two apples are on the board in a duel, to keep the narrow parts from filling up.

Speed-up

Classic, except that the snakes get faster as apples are eaten: every 5 apples, each tick is 6% shorter. However many apples go, a tick never gets shorter than 55 milliseconds, about 18 moves a second.

Kids

For younger players and anyone who wants a calm game. The speed is always Slow and the edges are joined, as in No walls. A crash doesn’t end the game: the snake shrinks back to 3 cells, turns toward a free cell and carries on. Each game lasts 90 seconds. Alone, your score is the apples you ate; with two snakes, the longer snake when time runs out takes the round. The direction pad (or the turn buttons) always shows in Kids mode, on any screen.

Speeds and board sizes

Speed One move every Moves a second
Slow 150 milliseconds about 7
Normal 110 milliseconds about 9
Fast 80 milliseconds 12.5

On the Large board every speed is 10% faster, so crossing the bigger board doesn’t feel slow. The board size is under More options: Small (14 by 14) makes a tight game where your own body soon fills the space; Large (26 by 26) gives room for very long runs.

Controls

  • Keyboard: the arrow keys or W A S D, alone. With two people, the first player has W A S D and the second the arrow keys.
  • Swipe: swipe on the board the way you want to go. With two people, each swipes in their own half of the board.
  • Direction pad: on a touch screen, four arrows for each player. With two people on a phone or tablet lying flat between you, the second player’s pad sits at the far side of the screen, facing them, so its up arrow points away from them. Turn buttons (the ⋯ menu) put two buttons in its place, left turn and right turn; one person can also move the pad to the left.
  • Pause: P or Esc, or the Pause button. The game also pauses by itself when you switch tabs or open a menu. When you carry on, a short countdown comes first.
  • Step mode (More options, alone): the snake moves one cell only when you press a direction. Nothing happens until you do, and after each move the game says where the nearest apple is and whether the next cell is a wall or an edge. It is the way to play with a keyboard at your own pace, or with a screen reader.

A round that is cut short, by a reload or by going back to the setup, is never half-saved: it starts again from the beginning, same apples, after the countdown. Finished rounds and the score of the match are always kept.

Playing against the computer

Choose 2 players and vs Computer, then pick a level. Easy steers clear of an immediate crash but wanders now and then and walks into tight spots. Medium also refuses pockets too small for its body and takes the shortest path to the nearest apple. Hard adds two things: it avoids a head-on with a snake as long as or longer than itself, and it plays for space, heading for the parts of the board it can reach before you and letting you have apples that are nearer to you. Adaptive starts gently and moves a step up after each match you win and a step down after each one you lose.

A short history of snake

Games in which a line grows across the screen and must not hit anything are old: arcade cabinets of the 1970s already had players steering lines that left a trail behind them, and walling each other in. The version most people know, a single snake eating apples to grow, spread to home computers and then to mobile phones in the late 1990s, where a small screen and a few keys were all it needed. The rules have hardly changed since: one cell at a time, one apple at a time, and nothing to hit but the walls and yourself.

Snake or Snakes and Ladders?

If you were looking for the board game with dice, ladders that carry you up and snakes that slide you down, that is Snakes and Ladders, with its own rules guide. Snake, the game on this page, is played in real time with no dice at all.

When you know the rules, the snake strategy tutorial shows how to plan turns ahead, keep space open for a high score and win duels.

Frequently asked questions

Something else? Ask us.

What are the rules of the snake game?

You steer a snake that moves by itself, one cell at a time, around a grid. Each apple it eats makes it one cell longer. The run ends when the head hits the edge of the board or any part of a snake's body, including its own. Your score is the number of apples you ate.

Can the snake go backwards?

No. The snake can turn left or right, but a press in the direction it came from is ignored, because the head would run straight into its own neck.

Can the snake hit its own tail?

Hitting any part of its own body ends the run. The one exception is the cell the tail is leaving on the same move: the head may move into it, because the tail moves on at the same moment. If the snake is eating an apple on that move, though, the tail stays, and the head would crash.

What happens when two snakes collide head-on?

When both heads move onto the same cell, or swap places with each other, the longer snake survives and the shorter one crashes. If they are the same length, both crash and nobody gets the round.

How do you win a two-player snake game?

Each round, the last snake still moving wins it. The first player to win 3 rounds wins the match, or 5 if you choose that under More options. If both snakes are still moving after 3 minutes, the longer one takes the round.

What does No walls mean in snake?

The edges of the board are joined. A snake that goes off the right edge comes back on at the left in the same row, and one that goes off the top comes back at the bottom. Only bodies can end the run.

What is Kids mode in snake?

A gentler game: Slow speed, no edges, and a crash doesn't end the game. The snake shrinks back to 3 cells and turns toward free space, and play goes on. Each game lasts 90 seconds; with two snakes, the longer one at the end takes the round.

What is the highest possible score?

The board sets it. A snake starts 4 cells long and gains one cell per apple, so it can eat until it fills every free cell: 396 apples on the Medium board of 20 by 20. When no free cell is left for a new apple, the run ends with Board full.

Next: learn to play well

Other rules guides

Add to your Home Screen

Install Pass and Play Games so it opens like an app and works offline.

  1. Tap the Share button in Safari’s toolbar.
  2. Scroll down and tap Add to Home Screen .
  3. Tap Add. The games now open from your Home Screen.

Settings

Look

ThemeSystem follows your device.
LanguageEnglish

This page is in English only

Playing

Accessibility

MotionReduce turns off sliding; fades stay.

Your data

Saved in this browser only.

App

Send feedback

Tell us what works, what doesn’t, or what to add. It comes straight to us.

What’s it about?

The page, the game and your type of device come with it, so you don’t need to say which game.