Tool guide
About this tool.
- A CSS sprite sheet joins many small images into one PNG. The page then loads a single file and each element shows its own piece through background-position, which saves requests and avoids a flash when icons appear.
- This tool decodes your images, arranges them on one canvas, and returns the sheet as sprite.png together with ready-made CSS (sprite.css) and a JSON map of every frame (sprite.json).
- Packed shelf-packs the sprites, tallest first, into rows that aim at a roughly square sheet. Horizontal and Vertical keep your order in one line. Grid puts every image in a cell as big as the largest image.
- Class names come from the file names: Logo.png becomes .sprite-logo, names that are empty or start with a digit become .sprite-img-N, and duplicates get -2, -3. Padding is added between sprites and around the edges.
Choose the images you want on one sheet. PNG, JPEG, WebP and GIF files work; the first frame of a GIF is used.
Pick a layout and the padding between sprites. Packed gives the smallest sheet, the other layouts keep a predictable order.
Set a class prefix and the pixel ratio. The CSS appears as text, and sprite.png, sprite.css and sprite.json are offered as downloads.
The JSON lists every frame by class name with its source file, position and size in sheet pixels, so scripts and game engines can use the same sheet.
- Logo.png and logo.PNG with prefix sprite → .sprite-logo and .sprite-logo-2.
- 1-up.png as the third file → .sprite-img-3, because a class name cannot start with a digit.
- Two images 32 × 32 and 16 × 16, Horizontal, Padding 2 → a 54 × 36 px sheet.
- The same two images, Vertical → a 36 × 54 px sheet.
- Three 10 × 10 images, Grid, Padding 0 → a 20 × 20 px sheet in two columns.
- Pixel ratio 2 on a 54 × 36 sheet → background-size: 27px 18px and halved sizes and offsets.
- Everything runs locally on a canvas; no image is uploaded.
- Transparent areas stay transparent in the PNG sheet.
- Frames never overlap, and padding surrounds every sprite, including the sheet edges.
- The JSON always holds real sheet pixels; pixelRatio in its meta says how the CSS was scaled.
- Class names are lowercased with accents removed, so ikona-ž.png becomes .sprite-ikona-z.
- Limits: 200 images, 10 MiB and 4,096 × 4,096 px per image, 8,192 px per sheet side.