Optimize an SVG
Drop SVG files or paste SVG code: SVGO removes what editors leave behind (metadata, comments, superfluous decimals) without changing the drawing. It is free and your files never leave your device.
Free, no sign-up, no limit Runs in your browser: your text and files are never sent or saved.
Optimize SVG
Drop SVG files here, several at once if you like.
SVG files are optimized in your browser and never uploaded.
How to use it
- Drop one or more SVG files, or paste SVG code and click “Optimize the code”.
- Keep the “Safe” preset (viewBox, titles and ids kept) or choose “Maximal” for the smallest file; fine-tune the options if needed.
- Compare the original and the optimized drawing side by side, and check the weight before, after and once gzipped.
- Copy the optimized code, download each file, or all of them in a ZIP archive.
Example
Input
A 240 × 120 px logo saved by Inkscape (metadata, sodipodi:namedview, editor comment, a script and an onclick handler), “Safe” preset
Output
logo-optimized.svg: 3.5 KB → 1.1 KB (−68%), 465 B once gzipped; viewBox and title kept, 2 risky items removed (script and event handler)
Good to know
- The “Maximal” preset rounds numbers to 2 decimals and renames ids: check the preview, especially for tiny drawings (viewBox of a few units) and SVGs styled or animated by CSS or JavaScript.
- Scripts, event handlers (onclick…) and javascript: links are removed by default. Untick the option only for an SVG you trust that needs them.
- If the optimized code is not lighter, the original is kept unchanged (unless scripts had to be removed).
- Comments starting with <!--! (licences) are kept. Embedded bitmap images (base64) are not recompressed.
- The gzip size is an estimate of what a web server sends with gzip compression (level 9); Brotli usually does a little better.
- Files over 20 MB are refused: SVGO would freeze the page.
Frequently asked questions
How do I optimize an SVG for the web?
Drop the file or paste the code, keep the “Safe” preset and download the result: editor metadata, comments and useless decimals are gone, the viewBox and titles stay. Check the gzip size too, since that is what a web server actually sends.
How much smaller will my SVG file be?
It depends on where it comes from. Exports from Inkscape, Illustrator or Sketch carry a lot of editor data and often shrink by half or more; hand-written or already optimised files gain little. If the result is not lighter, the original is kept.
What is the difference between the Safe and Maximal presets?
“Safe” only removes what never affects the drawing and keeps ids, so CSS and scripts that target them still work. “Maximal” makes several passes, rounds numbers to 2 decimals, shortens ids and merges paths: lighter, but check the preview, especially for tiny drawings or SVGs styled by CSS.
Does optimizing change how my SVG looks?
With “Safe”, no: shapes, colours and the viewBox are untouched. With “Maximal”, rounding can shift very small details by a fraction of a unit. The original and the optimized drawing are shown side by side so you can compare before downloading.
How do I optimize an SVG in Inkscape or Illustrator?
Inkscape offers Save As > Optimized SVG, and Illustrator has a Minify option in its SVG export settings. Running the exported file through this page afterwards removes what those exports still leave, and lets you batch several files at once.
Is it safe to optimize SVG files here?
Yes. Files are processed by SVGO inside your browser and never uploaded, and the tool is free with no sign-up. Scripts, event handlers and javascript: links are removed by default, which also protects you when the SVG came from an unknown source.