1. Home
  2. Design tools
  3. SVG Sprite Sheet Generator

SVG Sprite Sheet Generator

Drop your icon files and get one sprite with a symbol for each, plus the markup to use them.

Free, no sign-up. Runs in your browser: nothing is uploaded.

How to use SVG Sprite Sheet Generator

  1. Drop the SVG files.
  2. Check the ids and the warnings.
  3. Copy the sprite and the usage snippets.

Features

  • One symbol per file
  • Ids from file names, made unique
  • viewBox kept, fixed size removed
  • Warnings for clashing inner ids and missing viewBox
  • Optional id prefix
  • use snippets

Supported formats

Input

  • SVG files

You get

  • SVG sprite
  • HTML snippets

Private by design

Everything you enter is processed by your browser on this device. Nothing is sent to openWorkstand or anyone else, so the SVG Sprite Sheet Generator is safe for private and work data. After you have used it once while online, it also works without an internet connection. How local processing works

Good to know

  • Icons without a viewBox, width or height cannot scale and are flagged.
  • Cross-file id clashes are reported but not rewritten.

Guide

Building an SVG sprite sheet from separate icon files

An icon system with dozens of separate SVG files means dozens of requests or dozens of copies of the same markup. A sprite sheet gathers them in one file, where each icon is a reusable symbol, and a page draws any of them with a one-line use element. This page builds the sheet from the files you drop in, previews every symbol and writes the markup to use them.

Symbols and use

A <symbol> is a definition that is never drawn by itself; it only appears where a <use href="#id"> points at it. The symbol carries its own viewBox, so the icon scales to whatever size the referencing svg has. The sprite wrapper has display: none, so the definitions take no space on the page. When you place <svg width="24" height="24" aria-hidden="true"><use href="#icon-home"/></svg> anywhere, the browser renders the home icon at 24 pixels.

A worked example

Press Sample for three Lucide-style icons named home.svg, search.svg and star.svg, and type icon- into the prefix. The page reports three symbols with the ids icon-home, icon-search and icon-star. The sprite begins <svg xmlns="http://www.w3.org/2000/svg" style="display: none">, then <symbol id="icon-home" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> containing the path. The width and height are gone, but the drawing attributes remain on the symbol. The usage block lists one snippet per icon, such as <svg width="24" height="24" aria-hidden="true"><use href="#icon-star"/></svg>.

Inline or external

You can paste the sprite once near the top of the body, or save it as sprite.svg and reference sprite.svg#icon-home. The inline route is the most reliable: it works everywhere, can be styled and needs no extra request. The external route is limited by the same-origin rule, so the sprite must come from your own domain, and a file served from a CDN will not load into a use. A build step can inline the sheet into every page if you prefer an external source file.

Colour and size

Icons that draw with currentColor, as the sample does, take the text colour of wherever the use sits, so one CSS rule such as .button svg { color: #6366f1 } recolours them, and hover states work normally. Icons with hard-coded hex colours keep those colours. Sizes come from the width and height you give the referencing svg; the symbol’s viewBox scales the content to fit. Because the shadow content is inherited, CSS selectors on the outer page cannot reach into individual paths of a symbol.

Names and ids

The file name without .svg is turned into a lower-case, hyphenated id, so MyCoolIcon.svg becomes my-cool-icon, and the prefix is added in front. Two files that produce the same id get -2, -3 and so on. Use a prefix to avoid clashes with other ids on the page. If two icons contain internal ids, such as a gradient called a in each, the page shows a warning, because all ids in one document must be unique and the second gradient would be ignored. Rename the ids in the source or optimise the files first.

Edge cases

Accessibility is up to you: the generated snippets are marked aria-hidden for decorative icons. For an icon that carries meaning, remove that attribute and add a title or an aria-label to the outer svg or its button. A file with no viewBox falls back to its width and height, and if it has neither the page warns that the symbol will not scale. Only the fill, stroke and related drawing attributes of the root svg are carried over to the symbol, so other root attributes are lost. Very large sprite sheets slow the first paint if inlined in every page; split by feature.

Limits

The tool combines files; it does not optimise paths, merge duplicate definitions or rename internal ids. It handles single-root SVG files with a viewBox. Nothing is uploaded: the files are read locally.

Checked against the current version of the SVG Sprite Sheet Generator on .

Frequently asked questions

Can I colour a sprite icon with CSS?

Yes, if the symbol uses currentColor for its fill or stroke. The use element inherits the text colour of the place where it sits, so setting color on the svg or a parent changes the icon. Icons with fixed hex colours stay as drawn.

Does a sprite sheet beat inline SVGs for performance?

It saves repeating the same path data when an icon appears many times on a page, since each use refers to one definition. For a few icons used once the difference is small, so choose by convenience rather than speed.

Inline sprite or external file?

Inline is the safest: put the sprite in the page and refer to #id. An external sprite.svg#id works only on the same origin and needs care with caching.

Why do my icon colors not change?

Set fill or stroke to currentColor in the source SVG so it follows the text color. Fixed colors in the file stay fixed.

Keep working with the result

openWorkstand also includes a free workspace with documents, spreadsheets, tasks, projects and a calendar that save to a folder on your computer.