Skip to content

2048

The open-source source code for the 2048 sliding-tile puzzle game, playable in a browser.

Stars
13.5k
Forks
17.6k
Licence
MIT
Language
JavaScript
Last update
2.0 years ago
Type
App

No commits in over a year — check for forks or alternatives before adopting.

What it is

This repository holds the source code for 2048, a number puzzle game where you slide tiles together to build a 2048 tile. The README says it is a small clone of the mobile game 1024 and was made just for fun. You can play the game in a browser at the author's site, and the code is MIT licensed, so anyone can read or reuse it.

  • Play the game in a browser at the project's hosted page
  • Read the JavaScript source to see how tile sliding and merging can be implemented
  • Fork the repository and modify the game rules or look
  • Study mobile swipe handling, based on the contributor notes in the README

Great for

  • People who want to play 2048 without installing anything, via the hosted site
  • Developers who want a small, readable JavaScript browser game to study
  • Students learning how simple game logic and mobile swipe handling can be built
  • Anyone who wants to fork a short, self-contained game as a starting point

Not ideal for

  • People looking for a large, actively developed framework: the README describes the project as made for fun, with no release published and a last push in October 2024
  • Developers who need a production-grade game engine, since the README does not describe any engine or tooling beyond the game itself
Step-by-step guide: how to use 2048Install, first run, examples, tips and FAQs

How to get it

  1. 1

    Clone and build from source

    Clone the repository

    git clone https://github.com/gabrielecirulli/2048.git
  2. 2

    Run it

    • Clone the repository with git.
    • Open the index.html file in a web browser, or use the hosted version at play2048.co.
    • Use the arrow keys or swipe to move tiles and combine matching numbers.
  3. 3

    Get the most out of it

    • Read the CONTRIBUTING.md guide if you plan to send changes back upstream
    • Check the best score storage feature, which the README credits to a contributor
    • Use the MIT license terms in LICENSE.txt if you reuse the code

Downloads

Strengths

  • Small, self-contained codebase that is easy to read for a beginner programmer
  • MIT license allows reuse and modification
  • Widely known project with a long history of community contributions listed in the README

Trade-offs

  • The README is brief and does not document a setup process or project structure
  • No release is published, so there is no versioned download to rely on
  • Maintainers describe it as made for fun, so support and updates are not guaranteed

How it compares

ProjectStarsTypeLevelUpdatedBest for
2048 (this)13.5kAppbeginner2.0 years agoPeople who want to play 2048 without installing anything, via the hosted site
osu19.4kAppintermediate4 days agoRhythm game fans who want a free, open-source client
Craft11.1kAppintermediate2.6 years agoDevelopers who want to read a compact, real example of a voxel game in C
pixijs48.6kLibraryintermediate6 days agoWeb developers building interactive 2D graphics or animations
flame10.8kLibraryintermediate4 days agoFlutter developers who want to add a game to an app

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.