Minimo Digital
Minimo Digital

🎨 Sprite Sheet Generator

Combine multiple images into a single optimized sprite sheet. Perfect for reducing HTTP requests and improving web performance.

How It Works

  1. Upload multiple images (PNG, JPG, GIF)
  2. Set sprite dimensions and padding
  3. Generate sprite sheet automatically
  4. Download sprite image + CSS + JSON

Benefits

  • Reduce HTTP Requests: Load one image instead of many
  • Faster Loading: Fewer network round-trips
  • Better Caching: Single file caches more efficiently
  • Automatic Coordinates: Get CSS and JSON with exact positions

Try It Now

Upload your images and generate a sprite sheet:

Open Generator →

Features

  • ✅ Support for PNG, JPG, GIF, WebP
  • ✅ Custom sprite dimensions
  • ✅ Adjustable padding between sprites
  • ✅ Auto-generated CSS classes
  • ✅ JSON coordinate export
  • ✅ Transparent background support
  • ✅ No file size limits
  • ✅ 100% free, no sign-up required

How to Build and Use a CSS Sprite Sheet

A sprite sheet packs many small images, such as icons or UI badges, into one PNG, and CSS then shows one region at a time. The hard part is working out the pixel offsets by hand. The generator does the arithmetic and gives you the PNG, the CSS rules and a JSON list of coordinates. This page is the introduction; the tool itself is on the generator page. Your images are uploaded to the server, which builds the sheet and sends the result back.

Step by step

  1. Open the generator and choose your files under Upload Images.
  2. Set Sprite Width (px) and Sprite Height (px) (10 to 500). This is the size of one cell.
  3. Set Padding (px) (0 to 50), the gap between cells.
  4. Click Generate Sprite Sheet, then check the preview.
  5. Use Copy CSS, Copy JSON and Download Sprite Sheet (saved as sprite-sheet.png).

Worked example

Four icons named home.png, mail.png, search.png and user.png, cell size 64 by 64, padding 4. Images are placed in a square-ish grid, here 2 columns by 2 rows, filled left to right. The sheet is 2 x 64 + 4 = 132 pixels wide and 132 pixels high. The cells start at these positions:

  • home: x 0, y 0
  • mail: x 68, y 0
  • search: x 0, y 68
  • user: x 68, y 68

The CSS names each class after the file name without its extension, so .sprite-mail gets background-position: -68px -0px with width and height of 64px. In HTML, use both classes: <span class="sprite sprite-mail"></span>.

Limits and common mistakes

  • Every image is stretched to the cell size you choose. Its aspect ratio is not kept, so use sources with similar proportions.
  • The generated CSS points to sprite.png. Rename the download, or edit the url() to match the real file name.
  • File names become class names, so avoid spaces and special characters in them.
  • The sheet has a transparent background, and the order follows the order the browser sends the files.

For vector icons, see SVG Tools.

Frequently Asked Questions

What is a CSS sprite and why use it?

A CSS sprite combines multiple images into a single image file. Instead of making multiple HTTP requests for individual icons or images, the browser fetches one file and uses CSS background-position to display the correct portion. This reduces HTTP requests and improves page load performance.

How do I use the generated sprite in CSS?

After generating the sprite, use the provided CSS code. Each image gets a class with background-image pointing to the sprite file and background-position to offset to the correct image within the sprite. Apply the class to your HTML element.

Should I still use CSS sprites in 2024?

CSS sprites are less critical now that HTTP/2 multiplexes multiple requests over one connection. However, they still benefit HTTP/1.1 sites and are useful for bundling icon sets. For icons specifically, SVG sprites or icon fonts may be more flexible alternatives.

What image formats can I upload for sprite generation?

PNG and GIF are the recommended formats since they support transparency. JPEG images are also accepted but lack transparency support, which may cause unwanted backgrounds in your sprite. For best results use PNG with transparent backgrounds.