Start a project

Tool 72 of 194 · Images

Sprite Sheet Packer

Combine icons or game frames into one tightly packed sprite sheet, with the CSS and JSON to use it.

Sprite Sheet Packer

Your images

The sample packs twelve of this site's tool icons at different sizes.

Sprite sheet

The packed sheet, shown on a checkerboard so transparency is visible

CSS

Sprite CSS

JSON atlas

JSON atlas

Positions

ClassSizePosition (x, y)

01

What it does

Packs your images into the smallest sprite sheet it can find with MaxRects bin packing, then writes the PNG, a CSS class per image and a JSON atlas for games.

  • MaxRects packing (best short side fit), tried across sheet widths to find the smallest
  • Padding between sprites to stop edges bleeding
  • Power-of-two sizes for game engines and older GPUs
  • Retina CSS: @2x images shown at half size with background-size

02

Private by design

Everything happens in your browser. Nothing you type, paste or upload is sent anywhere, and it keeps working offline once the page has loaded.

03

What you get

The packed PNG, CSS classes, a JSON atlas and each sprite's position, with a Copy and a Download button on every result.

  • Sprite sheet
  • CSS sprites
  • Texture atlas
  • Images

Why it matters

A sprite sheet puts many small images into one file. For a game, it means one texture upload and fast drawing. For a website, it's less needed since HTTP/2, but it still helps for sets of small icons or hover states that should appear instantly. The work is in the packing: lay the images out badly and the sheet is twice the size it needs to be.

This packer uses MaxRects, the algorithm behind most texture packers. Each image goes into the free space it fits most snugly, measured on its short side. It runs at a range of sheet widths and keeps the one with the least wasted area. Add padding to stop neighbouring sprites bleeding into each other when scaled, or round the sheet up to powers of two for engines that need it. You get the PNG, a CSS class per image (with background-size for retina images) and a JSON atlas that game frameworks load directly.

How to use it

  1. Drop your images; file names become class names.
  2. Set padding, and tick power of two or @2x if you need them.
  3. Check the sheet and how much of it is used.
  4. Download the PNG, CSS and JSON.

FAQ

Are CSS sprites still worth it?

For many tiny icons or hover states that must appear instantly, yes. For a handful of images, HTTP/2 makes separate files fine. For icons, an SVG symbol sprite is usually better.

What does the efficiency figure mean?

The share of the sheet's area covered by your images. Above 85% is good; padding and very different sizes lower it.

Which JSON format is the atlas?

The TexturePacker JSON hash format, which Phaser, PixiJS and many other engines read.

Are my images uploaded?

No. They're packed and drawn in your browser.

Work with me

Want a site that gets these right?

I build fast, accessible websites and web apps that pass these checks from day one. Tell me about your project and I'll reply personally with honest next steps.

All developer tools · Back to leej.uk