SVG Optimizer
Shrink SVG files with SVGO, tune precision and plugins, and compare before and after side by side.
How to use the SVG Optimizer
- 1Paste SVG code or drop one or more SVG files.
- 2Adjust the number precision and switch individual optimizations on or off while watching the before and after preview.
- 3Copy the optimized SVG, download it, or download all files as a ZIP.
About SVG Optimizer
The SVG Optimizer shrinks SVG files with SVGO, the standard open-source SVG minifier, running in your browser. It removes what design tools leave behind, such as editor metadata, comments, unused definitions, empty groups and hidden elements, rounds coordinates, shortens path data and colors, and merges paths. The result shows the size before and after, the percentage saved and the gzipped size, with the original and optimized graphic side by side on a grid, light or dark background so you can spot any visual change.
Number precision sets how many decimals are kept, from 0 to 8; lower values save more but can shift fine details. Multipass repeats the optimization until nothing changes, and pretty print gives indented output instead of one line. Individual steps can be turned off: removing comments, metadata and editor data, shortening IDs, converting shapes to paths, merging paths, collapsing groups, inlining style rules and removing hidden elements. Extra options remove scripts and event handlers, the width and height (keeping the viewBox so the SVG scales), and the title. Drop several files to optimize them in one batch.
Web developers use it to make icons, logos and illustrations exported from Figma, Illustrator or Inkscape smaller before adding them to a site or app, which speeds up pages and keeps inline SVG readable. Previews are rendered as images, so scripts inside an SVG never run, and files never leave your device.
Frequently asked questions
Does optimizing an SVG reduce its quality?
Not with sensible settings: the shapes stay vectors and remove only redundant data. A very low precision can move points slightly in detailed drawings, so compare the two previews and raise the precision if something shifts.
Why did my SVG break after optimization?
Usually because CSS or JavaScript outside the file refers to IDs or classes that were renamed or removed. Turn off Shorten and remove unused IDs, and Inline style rules if styles go missing.
Should I remove the viewBox or the width and height?
Keep the viewBox: it defines the coordinate system and lets the SVG scale. Removing width and height is useful when CSS controls the size, because the SVG then fills its container.
How much smaller do SVG files get?
Files exported from design tools often shrink by 30 to 70 percent, mostly from metadata and long decimal numbers. Hand-written or already optimized SVGs save much less.
What is SVGO?
SVGO (SVG Optimizer) is a widely used open-source Node.js tool for minifying SVG files, also built into many build pipelines. This page runs its browser build with the default preset.
More in Developer Tools
Generate strong passwords and memorable passphrases.
Create QR codes for links, Wi-Fi and contacts with custom colors.
Get lorem ipsum and realistic test data as JSON, CSV or SQL.