Sprite Sheet Generator
Pack sprites into a texture atlas with a JSON frame map
Sprite Sheet Generator tool
Sprite Sheet Generator: key facts
- What it does
- Pack sprites into a texture atlas with a JSON frame map
- Category
- Image Tools
- Cost
- Free, with no account, sign-up, or install.
- Your data
- Runs entirely in your browser — the files and text you enter are never uploaded to a server.
- Last reviewed
- . Report an incorrect result.
Understanding the Sprite Sheet Generator
Every time a web page or game loads a separate image file for each icon, button state or animation frame, the browser or engine sends a separate HTTP request. For a set of thirty sprites, that is thirty requests — thirty round-trips of latency before anything renders. Combining them all into a single sprite sheet (also called a texture atlas) cuts that to one request, and the JSON frame map tells the engine exactly where each sprite lives in the combined image so it can draw only that region when needed.
Web developers use sprite sheets to deliver icon sets or UI elements in one optimized PNG, referencing each icon with a CSS background-position offset. Game developers pack animation frames and tile sets into atlases that the GPU can load as a single texture, dramatically reducing draw calls. The Sprite Sheet Generator packs your individual PNG, JPG or WebP images into rows under a maximum sheet width, with configurable padding, scale, and pack order. Drag rows in the sprite list to reorder them before packing, and if two files share a name, the second is automatically renamed (name_2, name_3, …) so nothing silently gets dropped from the export.
Two toggles handle the prep work that used to be manual: trimming crops each sprite to its opaque pixels before packing for a tighter sheet, and rounding the sheet size up to the next power of two matches what GPUs expect in a game engine. Packing itself uses a shelf algorithm — sprites are placed left to right, wrapping to a new row when the next one would exceed the max width — with an optional tallest-first ordering that reduces wasted space compared to plain upload order. It is not the globally optimal packing algorithm (that would be a bin-packing NP-hard problem), but it is fast, predictable, and handles the common case well.
The tool exports three files: the packed PNG atlas, a JSON frame map — either a simple flat format or one shaped to match TexturePacker's Hash JSON (compatible with Phaser and PixiJS atlas loaders) — and a CSS file with one class per sprite, ready to reference the PNG with a background-position offset. All processing happens on a canvas in your browser with no upload.
Sprite Sheet vs. Texture Atlas vs. Sprite Map — Is It the Same Thing?
If you have searched for a "sprite atlas generator" or a "sprite map maker" and landed here, you are in the right place — these names all describe the same output: many small images packed into one combined image with a data file recording where each piece sits. The term you use mostly depends on your community.
Web developers usually say "sprite sheet." Game engine documentation, from Unity to Godot, tends to say "texture atlas." Some 2D toolkits and frameworks call it a "sprite map." Whichever term you know it by, this generator produces exactly that: a single packed PNG plus a JSON frame map, so it works as a sprite sheet, a texture atlas, and a sprite map all at once.
Getting a result
- Drop your sprite images onto the upload zone — PNG is recommended to preserve transparency, but JPG and WebP are accepted. Drag rows in the list to reorder.
- Set the max sheet width in pixels (e.g. 512 for a 512×N sheet), padding between sprites, and a scale factor for @2x/@0.5x variants.
- Choose a pack order (upload order, or tallest-first for a tighter sheet), and turn on trim and/or power-of-two rounding if you need them.
- Pick a JSON format — Simple flat coordinates, or TexturePacker-shaped for Phaser/PixiJS.
- Click Download PNG to save the packed atlas, Download JSON for the frame map, and Download CSS for ready-to-use sprite classes.
Reasons to use it here
- Exports the PNG atlas, a JSON frame map, and a ready CSS file in one pass — other simple packers give you the image but make you hand-write the coordinates or CSS yourself.
- A TexturePacker-shaped JSON option is genuinely compatible with Phaser and PixiJS atlas loaders, not just "similar" to what they expect.
- Trim and power-of-two toggles automate the prep work sprite sheets normally require by hand, and a tallest-first pack order shrinks wasted space with one dropdown.
- No upload: sprites remain on your device, which matters when the assets are unreleased game content or proprietary UI.
Tips for Building a Clean Sprite Sheet
Packing the images is the easy part — a sheet is only as useful as the source files you feed it and the settings you pack them with. A few habits make the exported atlas far easier to work with in code.
- Name source files sequentially and consistently, like walk_01.png, walk_02.png, walk_03.png. The exported JSON keys each frame by its filename without the extension, so zero-padded, ordered names keep the frame keys readable and sorted correctly when you loop over an animation in code — and if a name repeats, the tool suffixes it rather than dropping the duplicate.
- Turn on "Round sheet size up to power of two" when the atlas is bound for a game engine — 256, 512, 1024 or 2048 output. GPUs handle power-of-two textures most efficiently and some older hardware and compression formats require them. For a CSS sprite sheet of web icons this does not matter: the browser references sprites by pixel offset, so any size is fine.
- Turn on "Trim transparent edges" instead of manually cropping each source file — the packer will crop every sprite to its opaque pixels before laying it out, which packs sprites closer together and produces a smaller, more efficient sheet. Keep a couple of pixels of padding in the tool itself to prevent bleeding between the now-tighter frames.
Frequently Asked Questions
What format should I use for the JSON in my project?
Two options. Simple format has a frames object keyed by sprite name, each with flat x/y/w/h properties, plus a meta object with the sheet's width and height — good for CSS math or a custom loader. TexturePacker format nests each frame's rect under a frame key alongside rotated, trimmed, spriteSourceSize and sourceSize fields, matching the Hash JSON shape Phaser and PixiJS atlas loaders expect, so you can drop it straight in.
What does "Trim transparent edges" actually do?
For each sprite, the tool reads its pixels on an off-screen canvas and finds the bounding box of anything with non-zero alpha, then packs only that cropped region instead of the full image bounds. This removes wasted transparent margins so sprites sit closer together and the sheet comes out smaller. If a sprite has no transparency (a JPG, or a PNG with no alpha), trimming has no effect on it.
Why is there a gap at the right edge of some rows?
The shelf packer places sprites left to right and wraps to a new row when the next sprite would overflow the max width. If the sprites in a row don't add up to exactly the max width, there is empty space at the right of that row. Switching Pack order to "Best fit (tallest first)" often reduces this by grouping sprites of similar height together, but some empty space is normal — frame positions stay accurate regardless.
Does it support transparency (alpha channel)?
Yes — the sheet canvas uses a transparent background by default, and PNG export preserves the alpha channel. Each sprite's transparency is maintained in the atlas. If you export sprites that have transparent areas as JPG they will be composited on a white background, so always use PNG for transparency-dependent sprites.
Is there a limit on how many sprites I can pack?
There is no hard limit built into the tool. Very large numbers of sprites (hundreds of high-resolution images) may produce a very tall sheet or run slowly due to canvas memory limits — trimming enabled adds a per-sprite pixel scan, which is a bit slower still. For large atlases, consider reducing the scale or splitting into multiple sheets.