CompressPictureCompress an image

SVG compress

Comments, editor data, unused IDs and extra decimals taken out — then both files drawn and compared, so you can see nothing visible moved.

Free · No sign-up · Photos stay on your device

or drop an SVG file hereLogos, icons and illustrations. Scripts are always taken out.

What makes an SVG bigger than it needs to be

An SVG is text: shapes written as coordinates. Drawing programs save far more than the shapes — their own settings, layer names, comments, metadata and coordinates to six or more decimal places. None of that changes the picture. This page takes it out with a short list of passes you can switch on and off, then checks the result by drawing it.

It is a careful subset, not every trick.

Shapes are not merged, paths are not converted between absolute and relative commands, and colours are not rewritten. The passes that remain are the ones whose effect the render check can prove. The file is parsed by your browser in this page — a parsed document never runs its scripts — and nothing is sent anywhere.

Questions people arrive with

How do I know the SVG still looks the same?
Both files are drawn by your browser as images, at their own size and at four times that, and every pixel of the two drawings is compared. The page prints how many pixels moved by more than 32 of 255 and how many changed at all — anti-aliasing at the edges often shifts a little when coordinates are rounded. If anything visible moved, it says so and suggests more decimal places.
Why were scripts removed?
An SVG can carry JavaScript and event handlers such as onload. A logo or icon never needs them, and they are a common way to smuggle code onto a page that accepts uploaded images. They are always removed here, links that start with javascript: as well, and the result says how many were taken out.
What is the difference between .svg and .svgz?
An .svgz is the same SVG compressed with gzip. Browsers open it when the server sends it with the right headers, and design tools usually open it directly. Most web servers already gzip or Brotli-compress .svg files on the way out, so for a website the plain .svg is usually the one to upload; the .svgz byte count shows what that transfer will roughly cost.
Will it break my animation or interactivity?
CSS and SMIL animation are kept, and any ID they refer to is kept. Scripted interactivity is not — scripts are removed by design. An SVG built as a small application should not be run through this page.
Why is the saving small on my file?
Because the file was already exported cleanly. Most of what this page removes is what drawing programs add: editor namespaces, metadata, comments, long decimals and nested groups. A hand-written or already-optimised SVG has little of that.

Elsewhere on this site

Photographic visual for Svg
Svg