Widgets

How to Add a 2048 Game to Your Website

LK Forge · 4 min read · Updated July 2026

You can add a full, playable 2048 game to any website, blog, or classroom page with a single line of code — free, with no sign-up, no plugin, and no script to install. Visitors slide and merge numbered tiles to reach the 2048 tile, and — unlike most 2048 embeds — this one ships with a built-in AI solver they can learn from. This guide covers the fastest way to embed the 2048 AI Solver, what makes it different, and where it works.

The quickest way: paste one embed snippet

An embed is just an <iframe> that loads the game from lkforge.com, plus a small credit line. Copy this into your page’s HTML where you want the game to appear:

<iframe src="https://lkforge.com/embed/2048/"
        width="100%" height="760" loading="lazy"
        style="border:0;max-width:480px"
        title="2048 AI Solver by LK Forge"></iframe>
<p><a href="https://lkforge.com/games/2048/">2048 AI Solver</a>
   by <a href="https://lkforge.com/">LK Forge</a></p>

The <iframe> is the live game; the <p> underneath is a plain credit link. Keep that line — the visible link is what keeps the widget free to embed. You can also copy this exact code straight from the “Add This 2048 Solver to Your Website” section on the game page.

What makes this 2048 different: a built-in AI solver

Most 2048 embeds are just the puzzle. This one includes two AI features that turn it into a teaching tool as much as a game:

  • AI Hint — names the best next move on the current board and explains why, so players learn the strategy instead of guessing.
  • AI Auto-Play — hands the whole board to an expectimax solver that plays the winning corner-snake strategy move by move, at a speed you control. It is a live demonstration of how to actually win 2048.

That makes the embed a good fit for a puzzle blog, a maths or logic lesson on greedy versus look-ahead strategy, or any page where you want a game that also shows how it is solved.

Where it works

Because it is a standard iframe, the embed works anywhere you can add HTML:

  • WordPress: add a Custom HTML block and paste the snippet.
  • Squarespace: use a Code / Embed block.
  • Wix: add an Embed HTML / iframe element.
  • Ghost: insert an HTML card.
  • Notion: paste the /embed/2048/ URL and choose "Create embed".
  • Plain HTML, an intranet, or a lesson page: paste the snippet straight into the markup.

The board is responsive — it fills the width you give the iframe up to a comfortable maximum — and works with both swipes and arrow keys, so it is at home on phones as much as on desktop.

That’s the whole job. Copy the embed code from the 2048 AI Solver page and paste it wherever a puzzle blog, a games page, or a classroom activity needs an instant, self-solving 2048.

Grab the embed code from the 'Add This 2048 Solver to Your Website' section on the game page — free, no sign-up.

Open the 2048 game

Frequently asked questions

Is embedding the 2048 game free?
Yes. The 2048 game is free to embed on any site, with no account, no API key and no usage limits. It runs entirely in your visitor’s own browser, so there is no server cost — we only ask that you keep the small "2048 AI Solver by LK Forge" credit line that comes with the embed code.
Does the embedded game include the AI solver?
Yes — the embed is the full game, not a stripped-down version. Visitors get the AI Hint button, which names the best next move, and AI Auto-Play, which hands the board to an expectimax solver that plays the winning corner-snake strategy live. It is the same engine as the full game page, so nothing is lost in the embed.
Does it work on phones and tablets?
Yes. Players can swipe to move on touchscreens or use the arrow keys and WASD on a keyboard. The board scales to the width of the space you give the iframe, and each visitor’s best score is saved locally on their own device.
Where can I embed it — WordPress, Wix, Squarespace, Notion?
Anywhere you can add HTML, because it is a standard iframe. In WordPress use a Custom HTML block; in Squarespace a Code/Embed block; in Wix an Embed HTML element; in Ghost an HTML card; in Notion paste the /embed/2048/ URL as an embed. On a plain HTML page or an intranet, paste the snippet straight into the markup.
Can players keep going after they reach 2048?
Yes. Making the 2048 tile wins the game, but players can choose Keep Going to chase 4096, 8192 and beyond. The game only ends when the board is full and no merges remain, and an Undo button takes back the last move.
Does the embedded game track visitors or set cookies?
No. Everything runs locally in the visitor’s browser — no moves or scores are sent to a server. The embed sets no tracking cookies and sends no analytics, so it is safe to place on a privacy-sensitive site, an intranet, or a page for children.