Tools / just for fun

The classic snake game. Use the arrow keys or swipe to steer, eat the food and avoid your own tail.

INTERACTIVE TOOL

Try it yourself.

Score 0

Use arrow keys or WASD. On touch screens, swipe the board to turn.

THE DETAILS

How it works.

Play the classic snake game online

A browser version of the game many of us first played on an old Nokia. There is nothing to download and no account to create. Press start, steer the snake into the food, and watch it grow longer with every bite. The longer it gets, the harder it is to avoid your own tail.

How to play

Start a new game and guide the snake toward the food. Use the arrow keys or W, A, S and D on a keyboard; on a touch screen, swipe across the board to turn. Each item you collect increases the score and adds a segment to the snake.

The game ends when the snake hits a wall or runs into its own body. Start again to try a different route.

Four ways to score higher

  • Work the edges. Keep the middle of the board free so you always have a way out.
  • Plan one move ahead. Decide where you will turn after the next piece of food, not when you reach it.
  • Follow your own tail. When the snake is long, tracing the path behind the tail is the safest way to buy time.
  • Avoid sharp reversals. Two quick turns in opposite directions is how most games end.

Common questions

Does it work on a phone?

Yes. Swipe anywhere on the board to change direction.

Is the score saved?

No. The score resets with every new game, and nothing is stored on your device or sent anywhere.

Why did you build it?

It is a small demonstration of what a browser can do with plain HTML, CSS and JavaScript, no game engine and no plugins. The same approach powers the interactive tools I build for client websites.

Want something interactive on your own site?

Games, calculators and configurators can be built directly into WordPress without slowing the site down. If you have an idea, describe it here and I will tell you what it takes.

Need a custom tool?

Let’s build yours

Calculators, generators and interactive features can be built into your own WordPress site.

Prefer email? f@mojibur.com