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

1
2
3
Html
Css/SCSS
Javascript

Author

1
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

1
HTML / CSS (SCSS) / JS (Babel)

Author

1
jesse z

Demo

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


3.MATERIAL GRADIENT 2048

Made with

1
2
3
Html
Css/SCSS
Javascript

Author

1
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

1
HTML / CSS (SCSS) / JS (Babel)

Author

1
Stephanie

Demo

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


5.LAZY 2048

Made with

1
HTML / CSS / JS

Author

1
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

1
HTML (Pug) / CSS (SCSS) / JS

Author

1
Simone Bernabè

Demo

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


7.2048 SIMPLE VERSION

Made with

1
2
3
Html
Css/SCSS
Javascript

Author

1
Alex

Demo

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


8.2048

Made with

1
2
3
Html
Css/SCSS
Javascript

Author

1
Naomi Bastian Weatherford

Demo

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