How to Use

  • Paste or Drop: Paste your SVG code directly into the editor or drag and drop an .svg file.
  • Configure: Use the checkboxes to select what data you want to strip (comments, metadata, hidden IDs, etc).
  • Review: Check the preview pane to ensure your graphic hasn't broken.
  • Stats: See exactly how many bytes you saved.
  • Export: Click download to get your cleaned file, or copy the new code to your clipboard.

*This tool runs entirely in your browser. Your images are never sent to a server.

This tool is free to use

If it saved you some file size, consider buying me a coffee to support future updates.

Buy me a coffee

SVG Scrub v1.0

Client-side SVG cleaner & optimizer
Preview will appear here
Original
0 B
Optimized
0 B
Savings
0%

What does SVG Scrub do?

SVG Scrub cleans and optimizes SVG code directly in your browser — stripping editor-generated bloat like comments, metadata, unused-looking IDs, and redundant data attributes, then rounding path coordinate precision to reduce file size. Paste code or drag in a file, and a live preview plus byte-savings stats show you exactly what changed before you export.

SVG files exported from design tools like Illustrator or Figma often carry a lot of editor-specific cruft that browsers don't need — this strips that out while keeping the visible result identical, which is the whole point of the live preview pane: you can confirm nothing broke before downloading.

Frequently asked questions

Is SVG Scrub free to use?

Yes, completely free with no account or usage limit.

Are my SVG files uploaded anywhere?

No. All parsing and optimization happens locally in your browser using the DOM parser — nothing is sent to a server.

Will optimizing break my SVG?

The live preview re-renders your SVG after every change so you can check visually before exporting. That said, always keep your original file — the ID-removal option in particular uses a simple pattern match rather than full usage-reference tracking, so on complex SVGs with internal references (like gradients or clip-paths linked by ID), it's worth double-checking the preview carefully before relying on the output.

What does "Remove Unused IDs" actually check for?

It's a straightforward heuristic: IDs containing common auto-generated patterns like "Layer", "g", or "path" get stripped. It isn't a full reference-tracking analysis of which IDs are actually linked to elsewhere in the file, so treat it as a helpful default rather than a guarantee — always check the preview.

Can I drag and drop a file instead of pasting code?

Yes — drag a .svg file directly onto the editor pane and it will load automatically.

Related tools