IMAGES / SVG COMPRESSOR

SVG compressor

Compress SVG code and compare file sizes and static previews before downloading. It runs in your browser.

Input

No file selected.

Optimization settings

Compact markup is always applied. Geometry, IDs, styles, viewBox, titles and descriptions stay by default.

Comments beginning with ! are kept, including common license notices.

Removes metadata elements and editor-specific data. This can remove attribution or editing information.

May change geometry, viewBox values, CSS targeting and appearance. Compare carefully before using the result.

Preparing tool…

How to compress SVG files

  1. Choose or paste an SVG

    Drop one UTF-8 SVG onto Choose file, select it from your device, or switch to Paste SVG code.

  2. Choose SVG optimizations

    Compact markup is always applied. Choose whether to remove comments or metadata. Optimize shapes and numbers reveals Decimal precision.

  3. 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.