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.
- Scripts, event handlers and javascript: links: always removed, and counted.
- Comments, the doctype and processing instructions.
- <metadata> and editor data from Inkscape, Sodipodi, Illustrator, Sketch, Serif and Figma.
- IDs that nothing in the file refers to.
- Groups with no attributes unwrapped; empty groups and definitions dropped.
- Coordinates rounded to 3 decimals by default, path data rewritten compactly (arc flags read exactly).
- Whitespace in styles and between elements — never inside text.
- A render check at 1× and 4×, and downloads as .svg and gzipped .svgz with both byte counts.
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?
Why were scripts removed?
What is the difference between .svg and .svgz?
Will it break my animation or interactivity?
Why is the saving small on my file?
Elsewhere on this site
- Compress PNGFor an icon that has to be a bitmap: palette or lossless.
- Image optimizer for websitesPhotos at every width in AVIF, WebP and JPEG, with a srcset snippet.
- Lossless image compressionPNG and JPEG made smaller with every pixel compared.

