SVG Optimizer: Make SVG Files Smaller with SVGO

  • Free
  • No sign-up
  • Runs in your browser
  • Version 1.0.1
  • Last updated 2026-10-25
Report a problem

SVG files saved from design programs carry a lot of extra data. Paste or open one, and get a smaller file that looks the same.

Your SVG

Before

Optimized SVG

After

Everything you enter is processed in your browser and is never sent to a server.

How to use

  1. Paste the SVG code into the left box, or press Open file. Press Load example to see how it works.
  2. The optimized code appears on the right with the size saved, and a picture of the file before and after so you can check it looks the same.
  3. Copy the code or download it as a file. Change the decimal places or switch options if the picture looks different.

Examples

The example SVG: a blue rounded square with a white circle and a check mark, exported from an editor
→ 715 bytes → 343 bytes (52% smaller)
The comment, the editor's metadata and namespace, the ids and the extra digits are removed.
rx="24.000000" and cx="60.000000"
→ rx="24" and cx="60"
Zeros after the decimal point add nothing.
An SVG with a script element and an onclick attribute
→ Both are removed
Scripts are removed by default. Untick Remove scripts to keep them.

How it works

The code is read into a tree, run through SVGO’s default set of plugins, and written out again. SVGO is an open-source tool used by many build systems. With Repeat passes on, it runs again until the output stops getting smaller, which finds more savings in some files.

The tool is tested with an editor-style SVG: the size must shrink, the comment, metadata and editor namespaces must be gone, the viewBox must stay, the decimal places setting must change the numbers, and scripts and event attributes must be removed when asked. The page example above is the exact result of those settings.

Sources

Frequently asked questions

What does SVGO remove?
Comments, metadata, editor-only data such as Inkscape and Sketch attributes, empty groups, unused ids, default values that repeat what the browser already assumes, and extra whitespace. It also rewrites paths in a shorter form and writes colors shorter, for example #ffffff as #fff.
Will the picture look different?
Normally not. The default of 3 decimal places is invisible at ordinary sizes. A very small or very large graphic, or a path with fine detail, may need more places: raise the setting if you see a difference. The before and after pictures let you check.
Why is the viewBox kept?
The viewBox is what lets an SVG scale to any size. Some optimizers remove it, which makes the picture stop scaling; this tool always keeps it. To make the picture fill its container, use Remove width and height, which keeps the viewBox.
Why remove scripts?
An SVG file can contain scripts that run when it is opened directly in a browser. Most SVG pictures never need them, and removing them is safer when you use an SVG from someone else. Previews on this page are shown as pictures, which never run scripts.
Can an optimized SVG get bigger?
Rarely, for a file that was already tiny or already optimized. The result line then says it is larger, and you should keep the original.
Is my file uploaded?
No. SVGO runs in your browser. Files up to 5 MB can be opened.
Version history
  • 1.0.1 — Makes the search title and description state the supported task, key formats and privacy benefit more clearly.
  • 1.0.0 — First release.

Last updated: