Free CSS Sprite Generator
Combine multiple images into a single sprite sheet. Free, fast, and works entirely in your browser with no sign-up required.
Updated
Image Sprite Generator
Combine multiple images into a single sprite sheet with CSS, SCSS, LESS output, retina support, and JSON manifest.
Settings
Images (0)
Click to upload or drag and drop images
PNG, JPG, WebP, GIF supported -- batch upload supported
About Image Sprite Generator
Combine multiple images into a single sprite sheet to reduce HTTP requests and improve web page loading performance. Get CSS, SCSS, or LESS code ready to use, plus JSON manifests for game engines.
- Fewer HTTP requests (faster page loads)
- Better caching (single file to cache)
- Reduced bandwidth (less overhead)
- Smoother hover effects (no image flicker)
- Horizontal: Images side by side
- Vertical: Images stacked vertically
- Grid: Fixed columns, uniform cells
- Packed: Bin packing for smallest size
- Retina @2x and @3x support
- CSS, SCSS mixins, and LESS variables
- JSON sprite manifest for game engines
- Custom sprite naming and batch upload
- Save and restore configurations
Usage: Upload your images, choose a layout and options, then click Generate. Click any sprite in the list to see its CSS position. Download the sprite sheet and code files together, or copy individual snippets.
Frequently Asked Questions
What is the Sprite Generator?
The Sprite Generator is a free online tool that combines multiple images into a single sprite sheet with corresponding CSS code for web optimization.
Is the Sprite Generator free?
Yes, it is completely free with no registration required. All sprite generation happens client-side in your browser.
Why use CSS sprites?
CSS sprites reduce HTTP requests by combining multiple images into one file, which improves page load speed and overall website performance.
Is my data safe with this tool?
Absolutely. The CSS Sprite Generator processes everything client-side in your browser. No data is uploaded to or stored on any server. Your content remains private on your device at all times.
Does the CSS Sprite Generator work on mobile devices?
Yes, the CSS Sprite Generator is fully responsive and works on smartphones and tablets. You can use it on any device with a modern web browser -- no app download required.
Do I need to create an account to use this tool?
No account or registration is needed. Simply open the CSS Sprite Generator in your browser and start using it immediately. There are no sign-up walls or usage restrictions.
What image formats are supported?
The CSS Sprite Generator supports common image formats including PNG, JPG/JPEG, WebP, and GIF. Some features may also support SVG and BMP depending on the specific tool.
How do I use the CSS Sprite Generator?
Simply enter your input in the provided field, adjust any settings to your preference, and the tool will process it instantly. You can then copy the result to your clipboard or download it.
Which browsers are supported?
The CSS Sprite Generator works in all modern browsers including Chrome, Firefox, Safari, Edge, and Opera. For the best experience, use the latest version of your preferred browser.
What is the difference between the horizontal, vertical, grid, and packed sprite layouts?
The layout decides how your images are arranged on the sheet, which affects its final size. Horizontal lines every image up in a single row, and vertical stacks them in one column — both are simple and predictable but can waste space when image sizes vary. Grid places images in uniform cells with a column count you choose, so it reads cleanly when icons are similar sizes. Packed is the smartest option: it uses shelf-based bin packing, sorting images by height and fitting them into the smallest reasonable rectangle, which usually produces the most compact sheet and smallest file. If your icons are mixed sizes, start with packed; if you want a tidy, evenly spaced set, use grid. Try a couple of layouts above and compare the generated sheet dimensions before you commit.
How does background-position work to show a single icon from a sprite sheet?
A sprite sheet is one image holding many smaller graphics, and CSS background-position shifts that image behind a fixed-size box so only the slice you want is visible. Each generated class sets the sheet as the background, fixes the element's width and height to the icon's dimensions, then offsets the image with negative coordinates — for example, background-position: -48px -16px pulls the sheet up and left so the icon at that spot lands inside the box. The browser loads the full sheet once and reuses it for every icon, which is why one request can serve dozens of graphics. This tool writes those exact offsets for you, naming one class per source file so you just add the class to an element. Generate your sheet above to get the ready-to-paste positioning code.
What is a retina sprite sheet and when should I enable @2x and @3x output?
Retina, or high-DPI, screens pack two or three device pixels into each CSS pixel, so a standard sprite can look soft on them. Enabling retina renders @2x and @3x versions of your sheet at double and triple resolution alongside the normal one, and writes the matching min-resolution media queries into the CSS so each device automatically loads the sharpest sheet it needs. Turn it on when your icons must stay crisp on modern phones, tablets, and high-DPI laptops — which is most production sites today. The trade-off is larger files, since @3x assets are nine times the pixel area, so for purely decorative or rarely-seen graphics the standard sheet is often enough. Check the retina option above and the tool handles the extra sheets and media queries for you.
What is the JSON manifest, and can I use these sprites in Phaser or PixiJS?
Alongside the CSS, the generator produces a JSON manifest in the TexturePacker hash format, which records each frame's name, position, and size on the sheet. Game and canvas engines read this atlas to slice individual frames out of one texture at runtime instead of loading many separate images. The format is compatible with Phaser, PixiJS, and other libraries that accept JSON sprite atlases, so you can load the sheet and manifest together and reference frames by their original filenames. This makes the tool useful beyond web CSS — it works for HTML5 game art, animations, and tile sets, not just interface icons. Use Download All above to grab the sprite sheet, your stylesheet, and the JSON manifest in one step so the atlas and image stay in sync.
Should I use PNG, WebP, or JPEG for my sprite sheet?
Pick the format by what your sprites contain. PNG is lossless and keeps full transparency, making it the safe default for icons, logos, and UI graphics that need clean edges or alpha. WebP usually gives the smallest file at the same visual quality and still supports transparency, so it is the best choice for performance when you do not need to support very old browsers. JPEG suits photographic content but has no transparency and can show artifacts on sharp lines, so avoid it for flat icons. For WebP and JPEG the tool exposes a quality slider from 10 to 100 percent, letting you trade file size against fidelity. For most icon sets, WebP with a high quality setting gives crisp results and the lightest sheet — choose your format above and compare the output size.
Related Tools
Free Image Resizer Online
Resize images to any dimension. Maintain aspect ratio or set custom sizes. Free, fast, and works entirely in your browser with no sign-up required.
Free Image Compressor Online
Compress PNG, JPG, and WebP images to shrink file size without losing quality. Free, fast, and runs entirely in your browser — no uploads, no sign-up.
Free Image Cropper Online
Crop images to any size or aspect ratio with visual editor. Free, fast, and works entirely in your browser with no sign-up required.
Free Favicon Generator
Generate favicons in all sizes from a single image. Free, fast, and works entirely in your browser with no sign-up required.
About the CSS Sprite Generator
The CSS Sprite Generator combines several separate images — icons, buttons, flags, UI states — into one packed image called a sprite sheet, and writes the stylesheet code that points each element at the right slice of that sheet. You upload your images, pick how they should be arranged, and the tool draws the combined sheet and the matching CSS in the browser. It is built for front-end developers, web designers, and game developers who want fewer network round-trips and tidier asset folders, with no sign-up and no upload to a server.
A sprite sheet works on a simple idea: instead of fetching twenty small icon files, the browser fetches one image and uses background-position to show only the rectangle it needs. Every modern browser supports this technique.
What you can configure
- Layout — four arrangements are available. Horizontal lines images up in a row, vertical stacks them in a column, grid places them in uniform cells with a column count you choose, and packed uses shelf-based bin packing to sort images by height and fit them into the smallest reasonable sheet.
- Padding — set 0 to 100 pixels of gap between sprites to avoid bleed at sub-pixel scaling.
- Output format — PNG for lossless transparency, WebP for the smallest file at high quality, or JPEG for photographic content. WebP and JPEG expose a quality slider from 10 to 100 percent.
- Maximum dimensions — cap sheet width and height (default 4096px, up to 16384px) so the result stays within a texture or memory budget.
- Retina sheets — optionally render @2x and @3x versions alongside the standard sheet, with the matching
min-resolutionmedia queries written into the CSS for you.
What the generator produces
Once you click generate, you get a downloadable sprite sheet plus ready-to-paste code in three flavours. The CSS output defines a base .sprite class and one positioned class per image, named from your file (sanitized to letters, numbers, hyphens, and underscores). The SCSS output ships the same data as reusable @mixin blocks, and the LESS output exposes each sprite's position and size as variables. A JSON manifest is also generated in the TexturePacker hash format, compatible with Phaser, PixiJS, and other engines that read JSON sprite atlases. Copy any block to the clipboard, or use Download All to grab the sheet, your chosen stylesheet, and the manifest together (including the retina sheets when enabled).
Click any image in the list to see its exact dimensions, its position on the sheet, and the CSS class you would use to display it.
Why combine images into a sprite
Each image on a page is normally a separate HTTP request, and every request carries connection and header overhead. Bundling many small graphics into one sprite means a single request and a single file to cache, which trims load time and bandwidth — most useful for sets of small, static UI assets. Sprites also remove the brief flicker that can happen when a hover-state image is requested for the first time, because every state already lives in the loaded sheet. Photographs and large images are usually better served on their own or via modern formats; sprites shine for icons and repeated interface graphics.
Private by design
Everything runs locally using your browser's canvas. Your images are read, combined, and encoded on your own device — nothing is uploaded, stored, or sent to any server, so unreleased artwork and client assets stay private. There is no account to create and no install. The tool can even save named configurations (layout, padding, format, and sprite names) to your browser's local storage so you can reload a setup later; that data never leaves your machine either.
Upload a few images above, choose a layout, and generate your sprite sheet and code in one step.