SVG optimizer: compress and minify SVG files
Drop SVG files (or a whole folder) and each one is optimized as soon as it lands: editor metadata, comments and hidden elements removed, numbers rounded, paths and groups simplified. The Safe preset keeps the picture identical and leaves ids, size and viewBox alone; Maximum squeezes out the last bytes for icons you inline.
How to use it
- 1
Drop SVG files or a folder, or paste SVG code.
- 2
Pick Safe or Maximum and adjust precision or individual cleanups — results update live.
- 3
Compare before and after, then download one file or all of them as a ZIP.
Questions
How much smaller will my SVG get?
Files exported from Illustrator, Inkscape, Figma or Sketch usually shrink by 30–70%: they carry editor metadata, comments, unused definitions and numbers with far more decimals than a screen can show. Hand-written or already-optimized icons shrink less.
Will optimizing change how my SVG looks?
Not with the Safe preset — it only removes what doesn't render and rounds numbers to 3 decimals. Lowering precision below 2 can shift fine detail slightly; the side-by-side preview shows exactly what you get before you download.
Why would an optimized SVG break my CSS or sprite?
Shortening ids renames them, so CSS rules, scripts or <use href="icons.svg#name"> references that point at the old names stop matching. Safe keeps ids; Maximum shortens them — use it for icons you inline as-is.
What is SVGO?
SVGO is the standard open-source SVG optimizer used by build tools like Vite, webpack and Next.js. This page runs it in your browser with sensible settings, so you get the same result without installing anything.
Should I remove width and height?
Removing them (keeping the viewBox) makes the SVG scale to its container, which is what you want for icons sized with CSS. Keep them when the SVG should show at a fixed size, for example in an <img> without CSS.
Are my files uploaded?
No. Optimization runs in your browser, in a background worker; nothing is sent to a server.
More free SVG tools
- SVG viewerPreview, edit, optimize, rotate and resize SVG code with a live preview.
- Crop SVGTrim the empty space around an SVG, or fit its frame to the drawing, in bulk.
- SVG to data URIEncode SVG as a data URI for CSS backgrounds, masks and HTML — and decode one back.
- SVG sprite generatorCombine many SVG icons into one sprite sheet of <symbol>s, with HTML and React usage.
Need more than one change?
The Splice editor edits SVGs visually — shapes, text, colors, layers — across many files at once, with the code in sync.
Open the editor