A Collection of free JavaScript 2048 game code examples.

2048 Game is developed using HTML, CSS, and JavaScript. Talking about the gameplay, it’s one of the most addictive games. All the playing methods are too simple just like the real one. All you have to do is move numbers on a grid to merge them to form the number 2048; after all, you can keep on playing the game by creating larger numbers. In each move, a new number of displays (2 or 4). The player has to move the numbers using arrow keys and try to collide the same two numbers which create a new number with the total sum of the two numbers.

1.2048 game

Join the numbers and get to the 2048 tile!

Made with

Html
Css/SCSS
Javascript

Author

Created by Gabriele Cirulli. Based on 1024 by Veewo

Demo

See the Pen 2048 game by Cam Song (@camsong) on CodePen.


2.2048

Tiles with matching number values can be merged into a single tile, which receives the values' sum. To move the board, use the directional arrows - or swipe.

Made with

HTML / CSS (SCSS) / JS (Babel)

Author

jesse z

Demo

See the Pen 2048 by jesse z (@jessezisme) on CodePen.


3.MATERIAL GRADIENT 2048

Made with

Html
Css/SCSS
Javascript

Author

ecto

Demo

See the Pen material gradient 2048 by ecto (@ectophage) on CodePen.


4.2048

Use your arrow keys to move the tiles. When two tiles slide into each other, they merge into one!

Made with

HTML / CSS (SCSS) / JS (Babel)

Author

Stephanie

Demo

See the Pen 2048 by Stephanie (@ramenhog) on CodePen.


5.LAZY 2048

Made with

HTML / CSS / JS

Author

Snazzy Sanoj

Demo

See the Pen Lazy 2048 by Snazzy Sanoj (@snazzysanoj) on CodePen.


6.RESPONSIVE 2048 GAME

Responsive 2048 with mobile touch support in JavaScript.

Made with

HTML (Pug) / CSS (SCSS) / JS

Author

Simone Bernabè

Demo

See the Pen Responsive 2048 with Mobile Touch support by Simone Bernabè (@simoberny) on CodePen.


7.2048 SIMPLE VERSION

Made with

Html
Css/SCSS
Javascript

Author

Alex

Demo

See the Pen 2048 simple version by Alex (@zedchi) on CodePen.


8.2048

Made with

Html
Css/SCSS
Javascript

Author

Naomi Bastian Weatherford

Demo

See the Pen 2048 by Naomi Bastian Weatherford (@astronaomical) on CodePen.