Guide the snake to eat the red food pellets and grow longer. The game gets faster as you score more points. Be careful not to hit the walls or your own tail!
Use Arrow Keys or WASD to change direction. Press Space or click the canvas to start/restart the game.
Snake Classic is one of the most iconic arcade games in the history of video gaming. Originally appearing on the Nokia 6110 mobile phone in 1997, the game quickly became a cultural phenomenon that defined a generation of mobile gaming. Before smartphones, before app stores, before touchscreens — there was Snake. The game's brilliance lies in its elegant simplicity: you control a line (the snake) that moves across the screen, consuming food items that cause it to grow longer. The challenge escalates naturally as your snake grows, leaving less room to maneuver without colliding with your own body or the walls.
Our browser version faithfully recreates the classic experience while adding modern touches like smooth animations, responsive controls, and a clean visual design. We've hand-coded every pixel of this game using HTML5 Canvas and vanilla JavaScript — no game engines, no libraries, just pure code crafted with care. The result is a fast-loading, smooth-playing experience that works flawlessly on any device with a browser.
While the Nokia version popularized Snake, the concept actually dates back to the 1976 arcade game Blockade developed by Gremlin Industries. Players controlled characters that left solid trails behind them — essentially making them longer with each move. The concept evolved through various iterations including Nibbler (1982), Worm (early personal computers), and eventually Nokia's version programmed by Taneli Armanto. Nokia's implementation sold over 400 million copies bundled with their phones, making it arguably the most-played mobile game before the smartphone era. Today, Snake remains a beloved classic and one of the first games many aspiring programmers learn to build.
Desktop Controls: Use the arrow keys (Up, Down, Left, Right) to change the snake's direction. The snake moves continuously — you only control which direction it turns. You cannot reverse direction (going right means you cannot immediately go left, as that would mean moving through your own body).
Mobile Controls: On touchscreen devices, use the on-screen D-pad buttons that appear automatically, or swipe in the direction you want the snake to move. Swipe up to go up, swipe right to go right, and so on. The swipe detection requires a minimum distance of 30 pixels to prevent accidental direction changes.
Game Mechanics: Each food item (the colored square) you eat adds one segment to your snake and increases your score. The game ends when the snake collides with any wall boundary or with its own body. After a game over, click anywhere or press any key to restart with a fresh game.
Beginner Strategy: When starting out, focus on keeping the snake in the center of the playing area. This gives you the maximum number of escape routes in any direction. Avoid the corners and edges early on — getting trapped against a wall with a long snake is the most common way to lose.
Intermediate Strategy: As your snake grows past 10-15 segments, start thinking in patterns. The most effective pattern is the "mowing the lawn" technique: move systematically back and forth across the screen in horizontal or vertical lines, like mowing a lawn. This creates predictable, safe paths and maximizes your coverage of the play area.
Advanced Strategy: For truly high scores (50+ food items), you need to master the "coiling" technique. Create tight spirals that keep your snake's body organized in a compact space, leaving the rest of the board open for maneuvering. Plan your path 3-5 moves ahead, and always ensure you have an escape route before committing to a direction. The most dangerous moments are when food spawns in a location that requires you to navigate through tight spaces between your body segments.
Speed Management: In our version, the game gradually increases speed as your score grows. This means strategies that work at slow speeds may fail at higher speeds because you have less reaction time. Practice at slower speeds to build muscle memory, then your reflexes will carry over as the pace increases.
Game designers and psychologists have studied why simple games like Snake create such compelling experiences. The answer lies in several psychological principles: First, the "near miss" effect — when you almost crash but narrowly avoid it, your brain releases dopamine similar to a reward, encouraging you to keep playing. Second, the clear cause-and-effect relationship between your actions and results creates a sense of mastery and control. Third, the difficulty curve is perfectly natural — the game gets harder exactly in proportion to how well you're doing, creating what psychologist Mihaly Csikszentmihalyi calls "flow state." This is the mental state where challenge perfectly matches skill level, creating deep engagement and loss of time perception.
If you enjoy Snake Classic, you'll likely appreciate these other games in our collection that share similar qualities:
Brick Breaker shares Snake's satisfying physics and progressive difficulty. Space Dodge tests your reflexes under increasing pressure, similar to late-game Snake. Pong offers the same retro arcade charm with competitive gameplay. Maze Runner exercises the same spatial reasoning skills needed for advanced Snake strategies.
I wrote Snake as the very first game for this site, and it's still my favorite to explain. The whole thing runs on a 20x20 pixel grid — the snake is just an array of coordinates, and each frame I add a new head position and pop the tail (unless food was eaten). Collision detection is dead simple: check if the head lands on any body segment or outside the grid. The trickiest part was mobile swipe detection — I added a 30px threshold so small finger jitters don't trigger accidental turns. The speed ramps up by shortening the frame interval as your score climbs. The entire game is under 150 lines of hand-written code.