Tools

SVG optimizer

Shrink SVG files with SVGO — strip editor metadata, round coordinates, merge paths — and preview the result before downloading.

Runs in your browserImages and colour22.7K
Free

Input

0 B

Result

The result will appear here.

SVGs exported from Illustrator, Figma, Sketch or Inkscape carry a lot that the browser never uses: editor metadata, empty groups, default attribute values and coordinates written to six decimal places. SVGO, the optimiser behind most SVG build tooling, removes it with its preset-default plugin set. Paste the markup to get the optimised file, a rendered preview to confirm nothing visible changed, and the size saved. SVGO 4 no longer removes viewBox or <title> by default, since both matter for scaling and accessibility, and the options here let you decide.

How it works

  • Decimal places sets the precision of every number in paths and transforms; 3 is invisible at icon sizes, while 1 or 0 can distort small details.
  • Multipass runs the plugins again until the file stops shrinking, catching paths that only become mergeable after an earlier pass.
  • Removing width and height leaves the viewBox in place, so the SVG scales to its container — what you want for icons sized in CSS.
  • The preview is drawn through an <img> tag from a data URL, so any script inside the SVG can never run on this page.

Where your data goes

Nowhere. This tool runs entirely in your browser: the text you paste is processed by the page and is never transmitted to a server or written to a log.

This tool is free and needs no account. Its results exist only in your open page and are not saved anywhere.

What it costs

This tool is free, with no sign-in and no points.

Common questions

Why should I keep the viewBox?
The viewBox defines the coordinate system that lets an SVG scale. Without it, an SVG given a new size in CSS is cropped instead of resized. Older SVGO versions removed it whenever width and height matched; version 4 stopped doing that, and keeping it is the right default.
Can optimisation change how my SVG looks?
preset-default is designed to be visually lossless, and the preview lets you check. When something does shift, the usual cause is a low decimal-place setting on a small, detailed icon, so raise it to 3 or more. IDs are shortened too, which matters only if CSS or JavaScript outside the file refers to them.
Is the <title> element kept?
Yes. SVGO 4 took removeTitle out of the default preset because screen readers announce the title of an inline SVG. If the graphic is purely decorative you can delete the title yourself and mark the element aria-hidden where you use it.
What about SVGs with embedded images or fonts?
Embedded base64 bitmaps and fonts are left as they are; SVGO optimises the vector markup around them. A file that is mostly an embedded PNG will barely shrink — compress or convert the bitmap separately, or export a real raster image instead.

The open-source behind it

This tool runs on svg/svgo, released under MIT. If you need the same behaviour inside your own program, that is the library to reach for.

svg/svgo

Also known as

  • svg optimizer
  • optimize svg online
  • svgo online
  • compress svg
  • svg minifier
  • reduce svg file size