Vectors, optimised not rasterised

Compress an SVG Online

An SVG is a text document, so it is optimised rather than re-encoded: the bloat an editor left behind is removed and the geometry stays exactly as it was.

Free to use. No account required. Files are processed in your browser.

Drag and drop your images here

or click to browse files

JPG PNG WebP GIF SVG

Up to 40 MB per image. Nothing is uploaded.

What Makes an Exported SVG Large

An SVG is a text document. Nothing in it is compressed the way a photograph is, so the file weighs exactly as much as the markup an editor wrote — and editors write a lot that nobody needs.

Open a logo exported from Illustrator, Figma or Inkscape in a text editor and most of the file is not the drawing. It is a block of RDF metadata, a namespace declaration for each editor that has ever touched the file, an id on every element whether or not anything refers to it, and coordinates written to six decimal places.

None of that shows up in the picture. All of it has to be downloaded by every visitor.

  • Metadata and comments

    The RDF block, the generator comment, the XML declaration and the DOCTYPE. Machine data about the file, invisible to a visitor, often the largest single block in an exported logo.

  • Editor attributes and ids

    Inkscape and Illustrator namespaces, layer labels, data-name, and every id that nothing references. An id that is referenced — by a mask, a clip path, a gradient or a stylesheet — is kept.

  • Over-precise coordinates

    12.345678 becomes 12.35. Path data is usually the biggest part of a drawing, so trimming the decimals there saves the most — without moving anything visible.

What It Never Touches

An optimiser that breaks a file is worse than a large file. These are the limits built into this one.

  • Ids that something references. Clip paths, masks, gradients, filters and animations all point at ids, and stylesheets select them. Anything referenced is kept; only ids with no reference anywhere are removed.
  • Stylesheet and CDATA content. The body of a style element is copied through untouched, so media queries, selectors and whitespace that matters survive.
  • Text a screen reader would read. A title or desc element with content in it is kept. Removing it to save 40 bytes is a bad trade. Only empty ones go.
  • The drawing itself. No element is restructured, no path is rewritten, and the viewBox is not rounded — that would move the coordinate system under the artwork.

If the file is malformed — a tag that never closes — the tool refuses it rather than guessing. An optimiser that silently repairs a broken file produces a document that differs from the one you started with, and that is the one thing it must never do.

When there is nothing to remove

An SVG that was already minified has nothing left to strip. The tool says so and reports the real numbers, which may be zero — or even slightly negative, because the output is re-serialised. Keeping the original is the better choice in that case, and the result tells you that instead of claiming a saving.

SVG and server compression

Most servers gzip SVG on the way out, which is separate from this: gzip shrinks the transfer, while optimising shrinks the file that is stored, copied, committed and served from a CDN. Doing both is normal. This tool also deflates SVG entries when you save a batch as a ZIP.

SVG Optimisation FAQ

Can I convert an SVG to PNG or JPG here?
No, and deliberately so. Rasterising a vector is a format conversion, not a compression: the result has fixed pixels, loses sharpness at any other size, and cannot be edited as a drawing. If you need a PNG for a specific place, that is a different job from shrinking the SVG.
Why did my SVG only get a little smaller?
Because the file was already lean. An SVG exported from a design tool usually loses a large share of its weight; one that was already minified, or hand-written, has nothing left to remove. The result reports the real before and after sizes, including the case where the output is not smaller.
Will the optimised SVG look identical?
Yes, within the precision you keep. Coordinates are rounded to two decimals, which is below what any display resolves, and nothing is restructured. Ids that something references, stylesheet content and accessibility text are all preserved.
Is the file uploaded?
No. The SVG is read and rewritten in your browser. The file never leaves your device, so there is no upload limit and nothing is stored anywhere.
Does this work for SVG used as an icon font or a sprite?
It works on a single SVG file. A sprite — one file containing many symbols — is optimised as one document, and ids inside it are kept when they are referenced by a use element, which is the mechanism a sprite depends on.
Preview