Black Friday: 50% off every paid plan with code BF50. Ends 5 December.

See prices

Free tool

SVG optimizer, smaller files, same picture.

This SVG optimizer makes SVG files smaller by taking out what a browser never draws: comments, editor data, metadata, empty groups and extra digits. Drop one file or a whole folder, see the size before and after, and drag a slider over the picture to check it looks the same. Safe mode is built to keep the look, and a pixel check tells you if it did. It runs in your browser with SVGO, so nothing is uploaded.

Need a custom tool, app or website? Contact us 
Or type or paste SVG code

Your SVG files are read and shrunk in this page. Nothing is uploaded.

How it works

Shrink, check, then download.

01 / Drop

Add your SVGs

Drop files, paste code, or press Ctrl or Cmd V. Many at once is fine.

02 / Check

Compare

Drag the slider over the picture. A pixel check draws both versions and counts any difference.

03 / Save

Download

Save one file, or all of them in a ZIP. A file that cannot get smaller is kept as it was.

Guide

How to optimize an SVG, with measured results.

An SVG optimizer makes an SVG file smaller by removing what a browser never draws and writing the rest in fewer characters. This one runs SVGO, an open source SVG optimizer, version 4.1.0, inside your browser. Safe mode only removes things that do not draw, so the picture should stay the same. Stronger mode runs SVGO's full default set, and it can move edges a little. Either way a pixel check draws both versions and tells you if anything moved, and the page also shows the gzipped size, which is what many servers send.

How to optimize an SVG

  1. Drop SVG files on the box, click it to choose files, or copy SVG code and press Ctrl or Cmd V. You can also open Or type or paste SVG code, paste the code and press Optimize this code.
  2. Under Settings, pick Safe or Stronger. Start with Safe.
  3. Read the size at the top of the side column. Drag the line over the picture to compare, and read the pixel check under it. Checker, White and Black change what sits behind the picture, which helps with white or black artwork. If Stronger changed the picture, press Use the Safe result for this file next to the pixel check.
  4. Look at What was taken out and What each step saved to see where the bytes went.
  5. Press Download the SVG. With several files, use Download all as a ZIP. Copy SVG code puts the optimized code on the clipboard, Copy as CSS data URI copies it as a url() value for a CSS background, and Add more files adds to the list.

Safe or Stronger

Safe removes the doctype, the XML line, comments, the metadata block, editor data from Inkscape, Sketch and Illustrator, unused namespaces, empty groups and empty attributes. It writes colours and path data shorter and keeps numbers to 8 decimal places, far finer than any screen can show. It keeps ids, classes, shapes and groups as they are. Stronger is SVGO's full default set: it also turns shapes into paths, joins paths, merges groups, moves styles onto elements, drops attributes that only repeat a default and rounds numbers to the places you choose, from 0 to 6. Three places is the default.

Six real SVG files from design work were run through this page in Chrome on 27 Oct 2026. The sizes are what the page showed. Your files will differ, and so will your savings.

FileOriginalSafeStrongerPixel check
Illustrator export of an arrow, long numbers36.1 KB26.8 KB15.8 KBSafe identical. Stronger: 0.238% of pixels differ.
Figma export of a wordmark, paths only6.14 KB4.00 KB3.79 KBSafe: 27 of 161,792 pixels differ, by at most 8 of 255. Stronger: 0.893%, up to 62.
Figma export with blur filters2.17 KB2.10 KB2.04 KBIdentical in both.
Figma export with a PNG picture inside108.9 KB108.9 KB108.8 KBSafe identical. Stronger: 3.933% differ, up to 255.
Figma export with a drop shadow filter204.1 KB203.7 KB203.4 KBSafe identical. Stronger: 0.878% differ, up to 255.
Page capture that holds HTML (foreignObject)347.8 KB344.1 KB342.2 KBNot possible, see below.

What this shows. The arrow came from Illustrator with numbers like 227.000000, and it shrank the most: 25.7% in Safe and 56.2% in Stronger. The Figma files were already compact, so they saved from 0.0% to 6%, and the picture inside the fourth file cannot shrink at all. In the page's own pixel check, Safe found no difference in four files and a tiny one in a fifth, the sixth could not be checked, and Stronger changed the picture in four of the five that could be checked, at the edges of shapes. A second check in Chrome drew each original and each result at 800 by 800 pixels and compared them with an image library: Safe was identical for all six, and Stronger differed in four, by 52 to 7,851 of 640,000 pixels, the largest difference being 26 to 69 out of 255. These are small edge shifts, but they are real, which is why Safe is the default and the page shows the check every time.

The page cannot read the pixels of an SVG that holds HTML, because the browser blocks it, so for that last file it says so and leaves the comparison to the slider. In the Chrome check that file looked identical after both modes.

Smaller file, or smaller after gzip

Many servers send SVG gzipped, and gzip likes repeated text. The page shows both sizes. On the arrow, Safe made the file 25.7% smaller, but its gzipped size went from 10.7 KB to 12.2 KB, because shorter path data repeats less. Stronger brought it down to 7.29 KB. If your server compresses SVG, read the gzip line and not only the first number.

Ids, titles and styles

Keep ids as they are is on by default, because CSS or JavaScript outside the file may point to an id, and shortening it would break that link. If nothing outside the file uses them, turn it off in Stronger: on the logo that took the result from 1,587 to 1,319 bytes. Keep title and description is also on by default, since screen readers read them. Turn it off only for a purely decorative picture.

If you place the SVG inline in a web page, its style rules can affect the rest of the page, and the page's CSS can reach into it. Check the result in the page itself before you replace the old file.

Width, height and CSS use

Tick Remove width and height, keep the viewBox when the SVG should fill whatever space the page gives it, as an icon in a button does. SVGO then drops the width and height of the outer element and keeps or adds the viewBox. Without a viewBox the browser has no size to scale from, so check the result in your page. Copy as CSS data URI gives a value like url("data:image/svg+xml,...") with the code inside, for a background-image rule, with only the characters that need it escaped and double quotes turned into single ones.

What it does not do

  • A picture embedded in the SVG as base64, such as a PNG, stays as it is. Compress that picture first with the PNG compressor.
  • Text stays text, so the viewer still needs the font. Convert text to outlines in your editor first if the font may be missing.
  • The file is not zipped. Many servers send SVG compressed with gzip or Brotli on top of what this does.
  • A file that cannot get smaller is returned as it was. The tool never gives you a bigger file.

Common problems

If the pixel check shows a difference you can see, press Use the Safe result for this file, or raise the decimal places in Stronger. If the browser cannot draw a file, it is probably not valid SVG. Files over 20 MB are skipped. To turn a picture into SVG first, use image to SVG, and to turn an SVG into a PNG use SVG to PNG.

Questions

Good to know.

How do I optimize an SVG file?

Drop it on this page, keep Safe selected and download the result. Safe removes comments, editor data, metadata and empty groups and writes numbers shorter, so the picture stays the same.

Will the SVG look different after optimizing?

Safe is built to keep the look. The page draws the original and the result in your browser and compares every pixel, so you see the result for each file. In six real files it found Safe identical in four, 27 of 161,792 pixels off by at most 8 of 255 in one, and could not check the sixth. Stronger changed the picture at the edges in four of the six, and the check tells you how many pixels for your file. The button next to the check switches that file to Safe.

How much smaller will my SVG get?

It depends on the file. Exports from Inkscape or Illustrator carry the most extra data. In the six real files above, Safe saved from 0.0% to 34.9% and Stronger from 0.0% to 56.2%.

Is my SVG uploaded anywhere?

No. SVGO runs in a worker in this page, and your files stay in your browser.

What is SVGO?

SVGO is an open source SVG optimizer under the MIT licence. This page uses version 4.1.0, served from this site, and does not change its code. The licence file in the project was read on 27 Oct 2026, and the bundle's other parts (css-tree, csso, css-select, css-what and sax) have licences listed beside it that allow this use.

Why did my SVG not get smaller?

It may already be as small as SVGO can safely make it, or most of it may be a picture inside the file, like the Figma export with a PNG inside above, where only 9 bytes could go. When SVGO cannot make the file smaller, the page returns your original and says so.

Can I optimize many SVG files at once?

Yes. Drop them together or use Add more files. Each gets its own size, picture and pixel check, and Download all as a ZIP saves them together.

Why does the gzipped size sometimes get bigger?

Gzip works by finding repeated text. Safe rewrites path numbers in a shorter form that repeats less, so a file can be smaller as plain text and a little bigger once gzipped. The page shows both, so you can pick the one that matches how your server sends the file.

Should I keep ids?

Keep them if CSS, JavaScript or another file refers to them, and in doubt. Turn the option off in Stronger only when nothing outside the SVG uses its ids.

Listed on

Listed on JustMacAppsMotionShine on Mac App IndexMotionShine on ScrollLaunchMotionShine featured on StartupBaseFeatured on FazierFeatured on Twelve ToolsMotionShine - Featured on Smol Launch