Sprite Sheet Generator

Put many small images into one PNG and get the code to show each one. Drop in icons for a website or frames of a game animation, choose a layout, and the tool packs them onto a single sheet with the padding you set. It writes CSS classes with the right background positions and a JSON map of every frame's position and size, ready for a game engine or animation library.

Loading image tool...

Features

  • Packed, grid, single-row and single-column layouts

  • Padding between sprites to stop edges bleeding

  • CSS classes with background positions, named after your files

  • JSON frame map with x, y, width and height of every frame

  • PNG, CSS and JSON together in one ZIP

  • Runs in your browser: images are never uploaded

Who builds sprite sheets

Game developers

Pack character animation frames into a grid sheet for Phaser, PixiJS, Godot or Unity, with a frame map to load them.

Web developers

Combine small icons into one image and one request, with ready CSS classes for each icon.

Email designers

Some email layouts use a single image with sprites for buttons and icons.

Students and hobbyists

Learn how sprite animation works by building a sheet from your own drawings.

Choosing a layout

Which layout to use

  • Grid: equal cells sized to the largest image. Best for animation frames, which are usually all the same size.
  • Packed: places the tallest images first on shelves, keeping the sheet roughly square. Best for icons of mixed sizes.
  • One row or one column: a simple strip, handy for CSS step animations.

Using the CSS

Every sprite gets a class built from the prefix and its file name, for example .sprite-home for home.png. Add both classes to an empty element: <span class="sprite sprite-home"></span>. The base class sets the sheet as the background; each sprite class sets the size and position. Keep the PNG next to the CSS file or change the url() to where you host it.

Tips

  • Name your files clearly before adding them: the names become CSS classes and JSON keys.
  • Use PNG with transparency for icons and game sprites.
  • For retina screens, make the sheet from images at twice the display size and set background-size to half the sheet size.
  • To cut an existing sheet back into pieces, use the Image Splitter.

Sprite Sheet Generator - FAQ