Free Online Image Sprite Sheet Generator
Pack a set of icons onto one sprite sheet in your browser and get the CSS to use it, with a class per icon named after its file and the exact background position. Grid, row or column, adjustable cell size, and a gap that stops sprites bleeding into each other.
Enjoying WizTools123? Help keep our server infrastructure 100% free and open for everyone.
How to Use Image Sprite Sheet Generator
Step by step, start to finish.
Drop in your icons. PNG with transparency works best.
Choose a grid (1 to 16 columns), a row or a column, and set the cell size if you need an exact one, up to 1024 pixels.
Set the class prefix, icon by default, and the file name the sheet will have on your site, sprites.png by default.
Download the sheet and copy the CSS. They are written to match each other.
Key Features
What this tool does, and what it does not do.
The icons are packed by your own browser, so an unreleased icon set stays on your machine.
A class per icon named after its file, with the exact background position, generated from the same numbers that drew the sheet.
A grid keeps the sheet compact, a single row or column makes the positions easy to read and edit by hand.
The sheet is a PNG with a transparent background, which is what an icon set needs.
A gap of 0 to 20 pixels, 2 by default, stops a neighbouring icon showing at the edge when the page is scaled.
Leave it at zero to fit the largest icon, or set an exact size and everything is centred inside it.
About Image Sprite Sheet Generator
A sprite sheet is one picture holding many small ones, with CSS moving a window over it so each element shows a different part. The point was always the same: one file to fetch instead of forty.
That mattered most when browsers fetched files one at a time. Browsers now fetch many files in parallel, so the saving is smaller, and it is still real. A fixed set of small images that always load together, never change independently and are needed immediately, such as flags, card logos, game tiles or interface chrome, is still better as one file than as forty.
The part that makes this tedious by hand is the arithmetic, and that is what is generated here. Every cell is the same size, so the CSS needs one width and one height for everything plus one position per icon, and those positions come from the same numbers that drew the sheet rather than being typed out afterwards. Each class is named from the file name, so the stylesheet reads the way the folder does.
Two smaller details matter more than they look. The gap between cells has a job: when a browser scales a page it can sample a pixel from the neighbouring cell along a sprite edge, and one or two pixels of space makes that impossible. And for high resolution screens the whole sheet should be built at twice the size and then halved in the CSS, and the generated stylesheet ends with a comment giving the halved width, height and background size for exactly that.
Everything is packed by your own browser. Nothing is uploaded.
Frequently Asked Questions
Common questions about this tool.
More Image Tools
Other tools from the same hub, free and in your browser.
Feedback
No feedback on this tool yet. Yours would be the first.