Skip to main content

SVG Minifier

Minify SVG: Strip Comments, Metadata and Whitespace

Clean SVG markup before it enters a repository or production build. Remove comments, XML declarations, editor data, empty groups, and unused definitions with 15 individually switchable passes and a visual comparison.

Drop files here

Editing defaults for new files

Preset

Everything in Safe, plus attribute cleanup, invisible-element removal, path optimization and rounded coordinates.

Optimization

How many decimals coordinates keep. Lower is smaller; below 2 can visibly move detailed artwork.

Preview

No preview. Add and select files to see results.

No files yet. Drop files above or click SELECT FILES.

What SVG minification removes

Minifying an SVG is markup work, not image processing: nothing is redrawn, things are only removed or shortened. A typical editor export carries an XML declaration, a doctype, a generator comment, Inkscape or Figma namespaces, id attributes nothing references, empty group wrappers, entries in defs that no element uses, and coordinates written to six decimal places. Browsers ignore all of it. Taking it out makes the file smaller and, just as usefully, makes the diff readable when SVGs are checked into a repository and reviewed like any other source file.

How to minify an SVG file

  1. 1

    Drop your SVGs, or click SELECT FILES, to add them to the queue. Up to 40 at a time.

  2. 2

    Pick Safe, Balanced or Maximum, switch off any individual pass you do not want, and watch the saving per file update.

  3. 3

    Click SAVE ALL to download the result, or a single ZIP when the queue holds more than one file.

Privacy: your files never leave your browser

Conversion runs locally in your browser using JavaScript and WebAssembly. There is no file upload or server-side conversion, so the files you add stay on your device.

Local processing helps protect confidential logos, internal documents, and unreleased client artwork. Pages and conversion code are cached as you use them, so tools you have already opened can continue working without a network connection.

Frequently asked questions

Is minifying the same as compressing?

Practically, yes: the same passes do both jobs, and this page and the SVG Compressor run the same engine. The difference is emphasis. Minifying is about the markup a human or an editor left behind, such as comments, metadata, namespaces and whitespace. Compressing is about the bytes on the wire, where rounding coordinates and dropping attributes matter more than tidy source.

Will minifying break my CSS or JavaScript?

It can, if a stylesheet or a script reaches into the SVG. No pass renames identifiers, but Maximum removes elements and attributes that nothing inside the document references, which is exactly what an external rule may be targeting. If the SVG is animated or scripted from outside, use Safe, or switch off Remove invisible elements and Remove unused definitions and check the result before shipping.

Can I keep the viewBox but drop width and height?

Yes. Normalize viewBox and Remove width/height are separate passes. Dropping the fixed dimensions while keeping the viewBox is what you want for an SVG that should scale to its container in CSS. Keeping them is what you want for a file that will be opened on its own or dropped into a document that applies no styling.