Skip to content
Run here 100% in your browser, no upload, no login

CSS Sprite Generator

Combine images into one sprite sheet and get background-position CSS for each icon.

Sprite sheet

CSS output

Images are composited on a canvas in your browser. Nothing is uploaded, and the download stays on your device.

How to use it

  1. Click Choose images and pick two or more files. Multiple selection is supported, and order follows the order you selected them.
  2. Choose a Layout. Horizontal puts everything on one row, vertical stacks it in one column, and grid wraps into the number of columns you set.
  3. Set Spacing if you want transparent padding between images, and Columns when the grid layout is active.
  4. Click Build sprite. The sheet appears on the canvas, each image is listed with its size and offset, and the CSS panel fills with one rule per image.
  5. Download the PNG, save it next to your stylesheet, and paste the CSS. Change the file name in the base class if you do not call it sprite.png.

Common use cases

Why it stays private

Images are decoded and composited on a canvas inside your browser. Nothing is uploaded and the PNG is produced locally, so unreleased assets stay on your device.

FAQ

Q: Why is my sprite sheet transparent around the images? A: The canvas starts empty and only draws the images you loaded, so every untouched pixel stays transparent. Transparency in the source images is preserved.

Q: What class names does the CSS use? A: Each name comes from the file name, lowercased with non-alphanumeric characters turned into dashes, and prefixed with sprite-. Files that reduce to an empty name fall back to icon-1, icon-2 and so on.

Q: How large can the sheet be? A: It is limited by the canvas your browser will allocate. Very large sheets may fail to encode, in which case the tool reports the failure instead of handing you a broken file.

Your data stays on this device

CSS Sprite Generator runs 100% locally. Everything you paste or drop is processed by your own browser and never transmitted. Nothing is stored on our servers — close the tab and it is gone.

Nothing you type is sent to a server, logged, or used for analytics. The page works even with your network disconnected after first load.