Compress SVG files in your browser

An SVG is text, so this is lossless: the same shapes, written in far fewer characters. Nothing is uploaded.

SVG
No SVG selected
Drop a file to start
Drop SVG files here

or browse your device. Everything is processed on this device

No SVG to hand?

Got it on your clipboard?

How to compress an SVG

01
Drop the SVG files

One or a few hundred. They are read as text on this device and go nowhere.

02
Pick a precision

3 decimal places suits almost everything. Turn on Aggressive if the file is not driven by CSS or script.

03
Check and download

The preview is the compressed file itself, so if it looks right it is right.

What actually makes an SVG big?

An SVG is source code. Open one in a text editor and you will find the shapes written out as instructions, which is why the wins here come from deleting text rather than from re-encoding pixels, and why nothing about this is lossy. The same drawing comes out the other side, described in fewer characters.

An SVG exported from Illustrator or Figma carries a lot that is never drawn: an XML declaration, a DOCTYPE, a generator comment, an RDF metadata block, editor-only attributes in the inkscape and sodipodi namespaces, layer names, ids nothing references, and coordinates carried to six decimal places when the artwork is 24 pixels wide. None of that is drawn. Deleting it changes nothing you can see.

Two files will not shrink much, and both are really the wrong format for the job. An SVG holding an embedded base64 photograph is a raster image in a vector wrapper, and it belongs in WebP or JPG instead, where the encoder can actually work on the pixels. A traced photograph with two hundred thousand path points is the same mistake in the other direction: it is enormous, it is slow to render, and a normal raster image would be smaller and sharper.

The last thing, and the one nobody tells SVG owners: whatever you save here, serving the file with gzip or brotli takes another 60 to 70% off on top. SVG is text, and text compresses brilliantly over the wire. A minified 12KB icon set can land as a 3KB transfer. Minify first, because a smaller source still gzips smaller, then check your host actually has compression turned on for image/svg+xml, because plenty do not by default.

SVG compression FAQ

Why is my SVG file so big?

Usually because your editor wrote far more than the drawing needs: a metadata block, a generator comment, editor-only attributes, layer ids and coordinates at six decimal places. If it is genuinely huge, look for an embedded base64 image inside it, or a traced photograph with tens of thousands of path points. Those are the two cases where the format itself is the problem.

Does compressing an SVG lose quality?

No. This is lossless. Nothing is re-encoded, because there are no pixels to re-encode. The only setting that touches the artwork at all is coordinate precision, and at 3 decimal places a point moves by less than a thousandth of a unit, which is far below anything a screen or a printer can show.

How do I make an SVG smaller for the web?

Minify it here, then make sure your server sends it gzipped or brotli compressed. Minifying typically halves the file and gzip takes another 60 to 70% off that, so the two together matter far more than either alone. After that, look at whether the file should be an SVG at all: photographs and traced images belong in WebP or JPG.

Is it safe to remove the ids?

Only when nothing points at them, which is why ids are left alone unless you turn on Aggressive. Even then we scan the whole document first and keep any id used by url(#...), by an href, or by a CSS selector inside a style block. If the file contains a script or a SMIL animation, no id is touched at all, because code can name an element in ways we cannot see from the markup.

Should I inline my SVG or link it?

Inline it when you need to style or animate it with CSS, or when it is a small icon you would rather not spend a request on. Link it with an img tag when the same file appears on many pages, because then it is cached once and gzipped by your server. Inlined SVG is never cached separately and gets re-sent inside every HTML page that uses it.

Will it break my logo?

It should not, and the rules that stop it are the point of the tool. Text content, xml:space, and anything inside style or script is left byte for byte alone. Attributes that only look like defaults are kept when a parent or a stylesheet could be setting something else. If the file is not well formed we refuse it outright rather than hand back a broken drawing.

Can you convert my SVG to PNG or JPG?

No, and you probably should not want it. A vector scales to any size at any resolution, which is the one property you chose SVG for, and converting it away throws that out permanently. Our other tools cannot read an SVG either. The exception is a file that is really a photograph in a vector wrapper, which was a raster image all along.

What does an SVG minifier actually remove?

Comments, the XML declaration, an unreferenced DOCTYPE, the metadata block, editor namespaces, unused namespace declarations, attributes that restate a default, empty groups and defs, and every redundant character in path data. Colours are written in their shortest form. The result panel lists what went, on your file.

Drop more files

Same format joins the queue. Anything else re-routes to its own tool.