Free SVG optimizer

SVG optimizer: compress and minify SVG files

Shrink SVG markup with SVGO inside your browser. The original and the minified file are shown side by side with their sizes, so you can check the result before you download it.

Drop an SVG file to optimize

or

Runs in your browser · Nothing is uploaded · No account

What this tool actually runs

The optimizer is SVGO 4.1.0, the same engine behind most “SVG minifier” websites, called with its default plugin preset. You can lower or raise Number precision (how many decimal places coordinates keep; the default is 3), leave Multipass on so plugins run until the file stops shrinking, and optionally tick Remove width/height (responsive), which adds SVGO's removeDimensions plugin and leaves the viewBox in place.

The numbers and snippets below were produced by that same function, not by a different pipeline.

Measured savings on real markup

SourceBeforeAfter (precision 3, multipass)Saved
Inkscape-style export (namespaces, unused defs, long decimals)1,516 B337 B78%
Same file, one pass only (multipass off)1,516 B344 B77%
Figma-style 24 × 24 icon348 B275 B21%
Illustrator-style file with metadata and CSS classes828 B268 B68%
Already minified icon113 B113 B0%

The 78% drop is typical of desktop-app exports: Inkscape and Illustrator write editor namespaces, a <sodipodi:namedview> or RDF metadata block, unused gradients, groups that only exist as layers, and coordinates like 64.0000000000. None of that is needed to draw the picture. A tidy icon from Figma or a hand-written snippet has less fat, so it shrinks less. The captions above the previews use the same byte counts (for example Original · 1.5 KB and Optimized · 337 B · −78%).

Before and after: a 24 × 24 icon

This is the Figma-style file from the table, in full:

<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
  <rect x="3" y="3" width="18" height="18" rx="4" fill="#111827"/>
  <path d="M8 12.5L10.5 15L16 9" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
  <!-- Frame 128 from design system -->
  <g id="Frame128"></g>
</svg>

After a default optimize (348 → 275 bytes):

<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
  <rect width="18" height="18" x="3" y="3" fill="#111827" rx="4"/>
  <path stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m8 12.5 2.5 2.5L16 9"/>
</svg>

The empty Frame128 group and the comment are gone, white is written as #fff, the path uses shorter relative commands, and the viewBox is still there. On the Inkscape-style file the same pass also dropped inkscape and sodipodi namespaces, an unused <linearGradient>, a no-op translate(0,0) group, and trailing zeros in coordinates.

Precision, multipass and the responsive checkbox

Precision is the number of decimal places kept in path data and other numbers. 3 (the default) is a safe starting point. Icons drawn on a 24-unit grid often look identical at 1 or 2. Maps and fine lettering may need 4 or more — the slider goes up to 6. At 0, numbers become integers. On the Inkscape-style check mark, precision 3 kept m48 68 10.5 10.25L82 52; precision 0 rounded it to m48 68 11 10 23-26, which moves the corner. Use the right-hand preview after every change.

Multipass is on when you first load a file. A second pass can remove groups that only became empty after the first pass. In the measured Inkscape-style file that was a 7-byte difference and a leftover <g>. Turn it off only if a huge file feels slow.

Remove width/height (responsive) strips the fixed size and keeps the viewBox, which is the same end state as the responsive option on Resize SVG. Use it for icons that should fill a CSS box. If you only want a new pixel size and want to keep width and height, use the resizer instead of this checkbox.

How to use the optimizer

  1. Drop an SVG or paste the markup. Two previews appear, labelled with their sizes and the percentage saved.
  2. Move Number precision if you need more or less coordinate detail, and check the optimized preview.
  3. Leave Multipass on unless the file is so large that a single pass is enough.
  4. Optionally tick Remove width/height (responsive). Download the result (the name ends in .min.svg), copy the markup, or open it in the editor.

When to optimize, and what to watch for

Optimize the file you ship to a website or an app, and keep an unoptimized copy if you still expect to edit it. SVGO will often drop unused IDs and comments, convert CSS classes into presentation attributes or style values, and shorten IDs that are still referenced. That is fine for a static icon. It is a problem if a stylesheet or script is looking for id="star" and the file now has id="a", or if you were using a class name as a hook. Check those references before you delete the original.

If you still need to recolour, crop or resize, it is usually easier to do that first, on the source file, with the colour changer, crop or resize tools, and optimize at the end. For a bitmap copy, use the SVG to PNG converter — optimization does not change how the PNG looks, but a smaller SVG is quicker for the browser to rasterise. Keeping the vector as the master, and deriving a PNG only when the destination needs one, is the habit described in SVG vs PNG.

Questions

How much smaller will my SVG get?

It depends on the source. Measured with this page's own optimizer (SVGO 4.1.0, precision 3, multipass on): a typical Inkscape export with editor metadata and long decimals went from 1,516 to 337 bytes (−78%); a short Figma-style icon from 348 to 275 bytes (−21%); an already minified 113-byte file did not shrink at all. Design-tool exports usually land in the 30–80% range; hand-written SVG often barely moves.

Is this the same as SVGOMG?

Both use SVGO, the standard open-source SVG optimizer. This tool runs SVGO's default preset in your browser, with a precision slider (0–6, default 3), a Multipass checkbox (on by default) and an option to remove width and height for a responsive file. You can also open the result in the Vectopea editor.

Will optimization change how my SVG looks?

At the default precision of 3, the preset is meant to be visually lossless, and you can compare the two previews before downloading. Precision 0 or 1 can move path points (a check-mark corner in one measured file jumped when decimals were rounded to whole units). Always glance at the right-hand preview after moving the slider.

What does Multipass do?

It runs the optimizer repeatedly until the output stops shrinking. On a measured Inkscape-style file, one pass left a leftover wrapper group (344 bytes); multipass removed it and finished at 337 bytes. It is slightly slower on huge files and is on by default here.

Will my element IDs still be there?

Unused IDs (editor layer names, empty groups) are usually dropped. IDs that are still referenced, for example by <use href="#star">, are kept but may be shortened (#star became #a in a measured file). If your CSS or JavaScript depends on a specific id, check the output or add that id back after optimizing.

Are my files uploaded?

No. SVGO runs entirely in your browser. The original and the minified markup never leave your device.