Paste SVG code or drop SVG files to make them smaller. The optimizer removes metadata, comments and Inkscape, Illustrator, Sketch and Figma leftovers, rounds coordinates, compacts path data and collapses whitespace, then shows the size saved and a side-by-side preview so you can check nothing changed.
File
Original
Optimized
Saved
Actions
Original0 B
→
Optimized0 B
Saved0%
Gzipped–
Preview
Original
Optimized
Advertisement
Advertisement
How to use the SVG Optimizer
Add your SVG: paste the code into the Input box, or drop or choose one or more .svg files. A sample is loaded so you can see the result first.
Review the options. The defaults are safe for almost every file; choose a lower number precision for smaller files or Keep for exact coordinates.
Check the preview: the original and optimized images are shown side by side, and the visual check reports whether they look identical.
Copy or download the optimized SVG. With several files, click Download all (ZIP).
M 100.00000,48.000000 L 152.00000,92.000000 L 140,92
M100 48L152 92 140 92
Shorten colors
#FFFFFF, rgb(255,0,0)
#fff, #f00
Unused IDs
<rect id="rect833"> never referenced
<rect>
Empty groups
<g id="g841"></g>, <g> without attributes
removed or unwrapped
Width/height (optional)
width="200" height="200" viewBox="0 0 200 200"
viewBox="0 0 200 200"
How rounding stays accurate
Paths often use relative commands such as l 10.333 0, where each point is measured from the previous one. Rounding every step on its own lets tiny errors add up along a long path, so shapes can drift or fail to close. This optimizer tracks the exact position and the rounded position as it goes and rounds each relative step so that the rounded path always lands on the correctly rounded absolute point. The result is within half of the last kept decimal everywhere, no matter how long the path is.
Precision is counted in user units of the viewBox. With a 24 × 24 icon, 3 decimals means accuracy to 1/1000 of a unit, far below one screen pixel. With a viewBox of 0 0 1 1 each unit is the whole image, so keep 4 or more decimals.
What is kept on purpose
Text content inside <text>, <tspan>, <title> and elements with xml:space="preserve", including spaces.
Referenced IDs: gradients, patterns, clip paths, masks, filters, markers, <use> targets, animation triggers and IDs mentioned in CSS. IDs on <symbol> elements are always kept so SVG sprite sheets still work.
Accessibility: <title>, <desc> and aria-* attributes stay unless you choose to remove titles.
Scripts: when an SVG contains a script, IDs are not removed, because the script might look elements up by ID.
Frequently asked questions
How much smaller will my SVG get?
It depends on where the file came from. SVGs exported from Inkscape, Illustrator or Sketch often shrink by 30 to 70 percent because they contain editor metadata and long decimals. Files that were already minified may only shrink by a few percent.
Will optimizing change how my SVG looks?
With the default settings, no visible change is expected. Numbers are rounded to 3 decimal places and relative path coordinates are corrected so rounding errors do not add up. The tool renders both versions and compares their pixels so you can confirm the result looks identical; if you see a difference, raise the precision or choose Keep.
What precision should I use?
Use 3 for most icons and illustrations and 1 or 2 for large artwork measured in hundreds of pixels. Tiny viewBoxes, for example 0 0 1 1, need more digits, so choose 4, 5 or Keep.
Why keep the viewBox but remove width and height?
Without fixed width and height attributes, the SVG scales to the size of its container in CSS, which makes it responsive. The viewBox keeps its proportions. If the file has no viewBox, the tool creates one from the width and height before removing them.
Is it safe to remove IDs?
Only IDs that nothing references are removed. IDs used by gradients, clip paths, masks, use elements, animations or CSS rules are kept, IDs on symbol elements are always kept for sprite sheets, and no IDs are removed when the file contains a script.
Should I also gzip my SVG?
Yes. Web servers usually send SVG compressed with gzip or Brotli, which typically shrinks it a further 60 to 80 percent. The tool shows the gzip size so you can see what visitors actually download.
Are my files uploaded?
No. Everything runs in your browser with JavaScript, so your SVG files never leave your device.