100% free
SVG optimizer
Balanced optimizations with path and color rounding. Recommended for most SVGs.
0 Bytes
Basic cleanup
Removes the XML declaration, DOCTYPE, comments, metadata, and editor data.
Path rounding
Rounds numbers in paths to fewer decimal places (1.234567 to 1.23).
Color shortening
Converts RGB and HSL to hex and uses the short notation (#aabbcc to #abc).
Advanced
Removes unused definitions, shortens IDs, and cleans up empty containers.
How to compress an SVG in four steps
- Upload an .svg file or paste the SVG code into the input field.
- Choose a preset: 'Safe', 'Standard (recommended)', or 'Aggressive'.
- Read the size before and after optimizing. The tool also shows the savings in percent.
- Check the preview, optionally compared with the original. Then copy the code or download the file. The file name gets the suffix '-optimized'.
You can turn each option on or off on its own. How much you save depends on the SVG. An export from a design tool usually leaves more room than a file that was already cleaned up by hand.
What the three presets do
| Preset | What happens |
|---|---|
| Safe | Removes the XML declaration, DOCTYPE, comments, metadata, editor data (for example from Inkscape, Illustrator, and Sketch), empty attributes, extra whitespace, and opacity values of 1. Paths and colors stay unchanged. |
| Standard | Also rounds numbers in paths to two decimal places (more with a small viewBox) and in transforms to at least three. rgb() and hsl() colors become hex, and hex values like #aabbcc become #abc. It also removes unused definitions and empty containers. |
| Aggressive | Like Standard, but with one decimal place. It also shortens IDs to a0, a1, and so on, and removes hidden elements, meaning those with display:none or opacity="0". |
You set the decimal places yourself with a slider. If edges look rough after optimizing, raise the value.
When the optimizer leaves things alone
- The tool doesn't round paths with arc commands (a or A), because their parameters can't be separated safely.
- If your SVG contains a style element, a script, class attributes, or animations, the optimizer leaves ID shortening, unused definitions, empty containers, hidden elements, and opacity values alone. It can't tell for sure what refers to them.
- IDs that are referenced through url(#...), href, or aria-labelledby are kept.
- Named colors such as 'red' stay as they are. Only rgb() and hsl() values are converted.
Check before you use the result
The option 'Remove metadata' also deletes the title and desc elements. If you use them as alternative text for screen readers, turn the option off. A title or desc that is referenced through aria-labelledby is kept.
The optimizer reads your SVG as strict XML. If the code isn't well-formed, the tool shows an error message and offers no download. Compare the result with the original in the preview before you put the file on your website.
Frequently asked questions
What does the SVG optimizer do?
Which optimizations does it apply?
What is path optimization?
Are my SVG files uploaded to a server?
How much file size can I save?
Can optimization damage my SVG?
Which preset should I choose?
What happens to title and desc for screen readers?
How is this different from SVGO?
Related tools
Changelog
November 20, 2026
Preset display, rounding, and namespaces
- • Added this English version of the tool
- • Fixed: The preset selection no longer jumps back to "Standard" when you change an option. It shows the matching preset or, for custom settings, none
- • Fixed: Transforms are rounded to at least three decimal places, and scale and matrix values never become 0
- • Fixed: For SVGs with a small viewBox, the path optimizer rounds with extra decimal places and no longer distorts the shape
- • Fixed: "Remove editor data" also deletes the no longer needed declarations xmlns:inkscape and xmlns:sodipodi
- • Fixed: SVGs without xmlns are displayed in the preview, and the output contains the attribute. An <svg inside a comment before the root element is no longer changed
- • The answer on how this differs from SVGO now describes exactly what the tool does. New in the FAQ: choosing a preset and title/desc for screen readers
November 17, 2026
Option for default opacity values
- • The option now reads 'Remove opacity 1' and removes opacity, stop-opacity, and flood-opacity when the value is 1. Inherited properties stay untouched
- • Removed the option 'Merge styles' from the presets because it was never evaluated
- • Added a guide with instructions and use cases below the tool
- • Added related tools at the end of the page
December 20, 2025
SVGO-like optimizations
- • Path optimization with configurable decimal places
- • Color conversion (RGB/HSL to hex, short hex)
- • Transform optimization
- • Removal of unused definitions
- • ID cleanup
- • Preview comparison (original vs. optimized)
- • Preset selection (Safe, Standard, Aggressive)
Show older versions
December 17, 2025
Launch
- • Removal of XML declarations
- • Removal of comments
- • Removal of metadata
- • Removal of editor attributes
- • Whitespace cleanup
- • SVG preview