ZeroTool Workbench

SVG Optimizer

Compress SVG files in your browser with SVGO. Toggle plugins, compare byte savings, copy or download the cleaned markup. No upload, no signup.

100% Client-Side Your data never leaves your browser Free · No Sign-Up

Plugins

Ready

How to use

  1. Paste your SVG markup, or switch to the Upload File tab and drop a .svg file.
  2. Toggle the plugins you want. Defaults match SVGO’s preset-default; the eight primary toggles cover the most common decisions.
  3. Click Optimize SVG. The before / after preview shows byte counts, the saved percentage, and rendered visuals so you can spot regressions immediately.
  4. Use Copy output for a quick paste into your codebase, or Download .svg to save the cleaned file.

What gets removed

SVGO removes editor metadata, comments, hidden elements, default attributes, and other markup that does not affect rendering. It also rewrites path data, merges adjacent paths, and shortens color values. Real-world icons typically shrink by 40–70%, with the bulk of the savings coming from convertPathData, mergePaths, and cleanupNumericValues.

The two risky toggles

Remove viewBox and Remove width/height are off by default for a reason: an SVG without viewBox loses its responsive scaling, and one without width/height attributes inherits the rendering box from its parent — which is rarely what you want for downloadable icons. Turn them on only when you fully control the embedding context (for example, sprite sheets where the parent <use> sets the size).

When to optimize

  • Production builds: ship icons through your bundler with a vite-plugin-svgo or similar step. Use this tool to spot-check the output without spinning up a CLI.
  • Hand-authored or exported SVGs: Figma, Illustrator, and Sketch all leave editor metadata and unused id attributes that SVGO strips cleanly.
  • Inline SVGs in HTML: if you embed the markup directly, every kilobyte counts — the document blocks first paint until parsed.

Single-file by design

This tool optimizes one SVG at a time. Batch optimization, custom plugin authoring, and CI pipelines belong to the SVGO command-line tool — install it with npm install -g svgo and run svgo input.svg -o output.svg against folders or globs. Once you find the right toggle combination here, copy the equivalent svgo.config.js snippet from the SVGO docs and ship the same configuration into your build.

Need to convert SVG to a raster format afterwards, or extract it for React? Use ZeroTool’s SVG to PNG Converter and SVG to JSX on the optimized output.

FAQ

How is this different from SVGOMG?

Same SVGO core engine. ZeroTool's version pins SVGO to v4, exposes the eight most-used plugins as primary toggles, and ships native interfaces in English, Chinese, Japanese, and Korean. SVGOMG is English-only.

Will my SVG ever leave my browser?

No. SVGO loads as a JavaScript module into your tab, then runs the optimization on the SVG markup you paste or upload. Your input, the optimized output, and the plugin toggles all stay in your device's memory.

Why does my SVG look broken after optimizing?

The most common cause is the Remove viewBox toggle. Without viewBox, an SVG cannot scale responsively. Turn it off and re-optimize. Remove width/height has a similar effect for fixed-size icons.

What happens to inline <style> blocks and CSS classes?

By default SVGO inlines styles into element attributes and minifies them (inlineStyles + minifyStyles). If you need to keep classes for runtime CSS overrides, disable both plugins from the Show all 34 plugins panel.

Can I optimize SVGs that contain <script> elements?

Yes. SVGO preserves script content unchanged but still strips comments and reformats whitespace around it. External references such as <use href="sprite.svg#id"> are also preserved.