IMAGES / SVG COMPRESSOR
SVG compressor
Compress SVG code and compare file sizes and static previews before downloading. It runs in your browser.
Compare your result
Rendering preview…
Rendering preview…
Compare both versions before replacing your original.
Isolated static previews: remote images, fonts and styles are not fetched; scripts and animation do not run. Text uses the bundled DejaVu Sans font. Some SVG features are unsupported. The SVG downloads keep references and active content; these previews do not prove browser equivalence or make the file safe. Open either static preview to inspect its PNG, up to 800 pixels on its longest side.
How to compress SVG files
- Choose or paste an SVG
Drop one UTF-8 SVG onto Choose file, select it from your device, or switch to Paste SVG code.
- Choose SVG optimizations
Compact markup is always applied. Choose whether to remove comments or metadata. Optimize shapes and numbers reveals Decimal precision.
- Compare the SVG output
Press Optimize SVG. Compare byte counts and static previews, then use Download optimized SVG or Copy code. Download original keeps your source if the result is larger or unsuitable.
Frequently asked questions
Are my files uploaded?
Parsing, optimization and rendering run in your browser. Input contents and names are not uploaded, logged or saved by this tool.
Cancel stops processing. Reset clears inputs, results and settings. Leaving the page releases preview and download URLs.
Can SVG compression change appearance?
Yes. Default settings retain geometry attributes, IDs, styles, viewBox and accessibility titles/descriptions. The tool still rewrites the XML, compacts whitespace and removes the XML declaration. Optional shape and number optimization can change paths, round numeric values and affect CSS selectors. This is not a guarantee of visual equivalence, especially for interactive SVGs or embedded HTML.
Will the SVG always be smaller?
No. Existing compact SVGs may stay the same size or grow when serialized. The result reports actual UTF-8 bytes and the difference, including no reduction. Download original keeps the exact source bytes.
Are previews the same as opening the SVG?
No. Previews are static PNG thumbnails. Remote resources are omitted, a bundled font substitutes for requested fonts, scripts and animation do not run, and unsupported features may disappear. A failed preview does not prevent downloading valid optimized code. Check the SVG in its intended environment before replacing your original.
Does this sanitize SVG files?
No. Output retains scripts, event attributes, links and external references unless an enabled optimization changes their containing data. Nothing is injected into this page as markup. Only use downloaded SVGs in a context you trust; optimizing a file does not remove active content.
Which files and browsers work?
Use well-formed UTF-8 SVG XML. XML entities requiring a DTD are unsupported by the strict validator; expand them before processing. Preview support varies by browser. No file-size limit is imposed here, but available browser memory and browser capabilities can prevent processing or rendering. Cancel remains available while working.