AbraCalc

Snake

Play the classic Snake game in your browser. Eat food, grow longer, don't hit the wall!

Snake Score: 0
Embed this tool on your site
Cite this tool

APA

AbraCalc. (2026). Snake [Online calculator]. Retrieved from https://abracalc.com/game/snake-game/

BibTeX

@misc{abracalc-snake-game, author = {AbraCalc}, title = {Snake}, year = {2026}, howpublished = {\url{https://abracalc.com/game/snake-game/}} }

Did this tool answer your question?

How to play

  1. Steer with arrow keys or WASD — on mobile use the ▲▼◀▶ buttons.
  2. Eat the red dot to grow longer; your score equals your length minus 3.
  3. Avoid running into your own tail — the edges wrap around safely.
  4. Press Restart to start a new game at any time.

Use arrow keys or WASD to steer the snake. Eat the red food to grow. Don't hit yourself! On mobile use the arrow buttons below the canvas.

How it works

Snake is one of the most iconic browser games. You control a snake that moves continuously around a grid. Each time the snake eats a piece of food it grows one segment longer and a new food item appears at a random location.

The game ends if the snake runs into the border wall or into its own body. As the snake grows longer, navigating without self-collision becomes the dominant challenge.

Use arrow keys or WASD to change direction. The snake cannot reverse directly; pressing the opposite key is ignored to prevent an instant self-collision.

A practical high-score strategy is to move in a systematic sweeping pattern across the grid rather than chasing each food item directly. Sweeping keeps the snake's body predictably out of the way, whereas erratic chasing quickly leads to self-traps.

Worked example

Avoiding self-collision at medium length

  1. When the snake reaches roughly 10 segments, stop chasing food directly.
  2. Instead, guide the snake in wide rectangular loops around the perimeter of the grid.
  3. Eat food only when it appears along the current loop path without requiring a detour.
  4. Gradually spiral inward as the snake fills more of the grid.

Snake length doubles without any self-collision compared to aggressive food-chasing.

Common mistakes to avoid

  • Chasing each food item directly, causing the snake to criss-cross its own path and creating self-collision traps.
  • Turning too sharply in a confined space, leaving no room to manoeuvre before the tail clears.
  • Not planning an exit route before entering a narrow corridor between body segments.

Key terms

Segment
One unit of the snake's body; the snake grows by one segment each time it eats food.
Self-collision
When the snake's head runs into any part of its own body, ending the game.
Perimeter loop
A navigation technique where the snake follows the grid edges in a rectangle to avoid trapping itself.

Frequently asked questions

Does the snake wrap around?
Yes — the snake wraps around all edges so you can't hit the wall, only yourself.
How do I speed up?
The snake speed is fixed in this version; a longer snake is the challenge.