Skip to main content

Compress SVG

Make SVG files smaller in your browser and check that the picture still looks the same.

  • Free
  • No upload
  • Pixel check
Drop SVG files here SVG or SVGZ, one file or up to 100. Your files stay on your device.
Or paste SVG code

How to compress an SVG file

Add your files

Drop one SVG or up to 100 at once, or paste the code. SVGZ files are unpacked for you.

Check the picture

The original and the compressed version appear side by side, with an automatic pixel comparison.

Download

Save the SVG, copy its code, or take all files in one ZIP.

How much smaller will your SVG get?

It depends on how the file was made. We ran this tool on 41 SVG files saved from Adobe Illustrator that ship with two WordPress plugins on our server, 150.2 KB in total, with the default options. Each result was drawn at 800 pixels on its longer side and compared with its original, pixel by pixel.

Number precisionTotal size afterSavedAfter gzipLargest share of changed pixels in one file
3 decimals (default)115.3 KB23.2%50.1 KB0.04%
2 decimals97.0 KB35.4%40.7 KB2.2%
1 decimal78.7 KB47.6%31.9 KB7.6%

With gzip alone, the 41 originals were 64.4 KB. At 3 decimals, single files shrank by 12.9% to 44.2%, 35 of the 41 showed no changed pixels, and the other 6 stayed under 0.1%. These were small drawings shown much larger than usual, so rounding shows up early. Your own files may save more or less.

Tested by Compressor Picture on 27 November 2026. A pixel counts as changed when a color or transparency value moves by more than 16 on a scale of 0 to 255.

What the compressor removes and what it keeps

Removed or shortened

  • Comments left in the code
  • Private data added by editors such as Inkscape, Sketch and Adobe Illustrator, including metadata blocks
  • Extra decimal places in paths, shapes and positions
  • Empty groups, spare spaces and unused namespace declarations
  • Long color codes that have a short form, such as #ffcc44 written as #fc4

Kept

  • The viewBox, so the drawing still scales
  • IDs, classes and styles that your CSS or scripts may use
  • Text, scripts and links inside the file
  • Titles and descriptions, unless you choose to remove them, because screen readers can use them

Which number precision should you choose?

An SVG describes shapes with numbers. Editors often write six or more decimal places, far more than a screen can show. Rounding them is usually where much of the saving comes from.

Start with 3 decimals. Choose 4 or 5 if the drawing has a very small viewBox or fine detail that will be shown very large. Try 2 or 1 for simple icons, then read the pixel check and compare the two previews before you download. Choose Keep all numbers if you only want to clean out editor data.

A compressed SVG is no longer a comfortable working file, because editor layers and settings are gone. Keep your original for future editing.

When SVG compression will not help much

If your file holds an embedded photo, most of its weight is that bitmap, and this tool leaves it as it is. The tool tells you when it finds one. If you need a normal image instead of a vector file, use SVG to PNG. For other formats, see Compress PNG, Compress WebP or the main image compressor.

SVG compression questions

No. The tool reads, compresses and compares the files inside your browser. They are not sent to us.

Removing comments and editor data does not change the drawing. Rounding numbers can move edges very slightly, which is why the tool compares both versions and shows the share of changed pixels.

The viewBox is kept and width and height stay the same, apart from rounding extra decimal places.

Many web servers send SVG files with gzip or Brotli compression. This number shows the size of the result after gzip, which is closer to what a visitor downloads from such a server.

It was probably optimized before, or most of it is an embedded bitmap or font. If the result would not be smaller, the tool keeps your original.

Animation elements are kept. The pixel check compares still pictures, so open the result in your browser and watch the animation before you use it.

Up to 100 files at a time, each up to 20 MB. With more than one file you can download them together as a ZIP.