BYTETOOLS

SVG Minifier

Minify SVG files in your browser: strip comments, metadata and editor junk, round coordinates, collapse whitespace — with a live preview and size savings.

Drop an .svg file here or click to browseProcessed entirely in your browser
2

What is the SVG Minifier?

The ByteTools SVG Minifier shrinks SVG markup without changing how it looks. It strips comments, XML declarations, <metadata> blocks and the editor-specific clutter that Inkscape and other tools leave behind (sodipodi: and inkscape: elements and attributes), collapses whitespace between tags, and rounds path and coordinate numbers to a precision you choose.

  • Removes comments, XML declaration, DOCTYPE and <metadata>
  • Strips Inkscape/Sodipodi editor elements and attributes
  • Rounds path and coordinate numbers to a chosen precision (0-5 decimals)
  • Optionally removes width/height when a viewBox is present
  • Live preview plus before/after byte counts and percentage saved
  • 100% client-side — files never leave your browser

How to use the SVG Minifier

  1. 1

    Paste your SVG code or drop an .svg file.

  2. 2

    Choose the coordinate precision and toggle the cleanup options.

  3. 3

    Click Minify SVG and compare the before/after sizes.

  4. 4

    Check the preview, then copy the result or download the minified file.

About the SVG Minifier

The ByteTools SVG Minifier shrinks SVG markup without changing how it looks. It strips comments, XML declarations, <metadata> blocks and the editor-specific clutter that Inkscape and other tools leave behind (sodipodi: and inkscape: elements and attributes), collapses whitespace between tags, and rounds path and coordinate numbers to a precision you choose.

Exports from design tools routinely carry more editor bookkeeping than actual artwork, and coordinates with eight decimal places where one would do — rounding alone often cuts file size dramatically. You can also drop a fixed width and height in favour of the viewBox to keep the graphic responsive. A before/after byte count shows exactly what you saved, and a live preview confirms the result still renders identically.

Minification is 100% local: paste SVG code or drop a file, and nothing is ever uploaded. Copy the output or download the minified .svg.

Frequently asked questions

Will minifying change how my SVG looks?

Structural cleanup (comments, metadata, whitespace) is completely lossless. Rounding coordinates is visually lossless at sensible precision — 1 to 2 decimals is imperceptible for typical icon and illustration sizes — but extreme rounding of very small, detailed paths can shift shapes, which is why the live preview is there to check.

What is all the sodipodi and inkscape stuff in my SVG?

Inkscape stores its own editing state — guides, grid settings, window positions — in custom sodipodi: and inkscape: namespaced elements and attributes. Browsers ignore all of it, so removing it is pure savings with zero visual effect.

Should I remove width and height from an SVG?

If the file has a viewBox and you want the graphic to scale to its container (typical for inline icons), removing fixed width/height makes it responsive. Keep them when the SVG is used standalone or as an <img> where you want an intrinsic size — that is why it is an option, off by default.

What coordinate precision should I choose?

For icons drawn on a 24 or 32 unit grid, 1-2 decimal places is safe and saves the most. For large or highly detailed artwork, use 2-3. Precision 0 (integers) gives maximum savings but is only safe for coarse shapes — check the preview.

How is this different from gzip on my server?

They stack. Minification removes bytes before compression, so the gzipped transfer is smaller too — and the saved bytes also help where gzip does not apply, like inline SVG in a JS bundle or data URIs in CSS.

Is my SVG uploaded for processing?

No. Parsing, cleanup and preview all happen in your browser tab, so logos and unreleased artwork stay on your machine.

Related tools