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