SVG Cleaner (Remove Metadata and Comments)
This SVG cleaner removes common bloat like metadata, comments, editor namespaces, XML declarations, and other extra tags so your SVG is smaller, safer to preview, and easier to reuse in web apps, icon systems, and design pipelines. Paste SVG markup or upload a file, verify the preview, and export a cleaned SVG. Processing runs entirely in your browser.
Remove metadata, comments, editor junk, and other bloat from SVG files. Runs fully client-side.
When to use this instead of the minifier: choose the cleaner when you want safer markup, fewer editor leftovers, and script-related cleanup before worrying about the smallest possible file size.
Quick workflow
Use this checklist to get a clean export fast, without breaking references like gradients or clip paths.
- 1) Start with SafeSafe removes obvious bloat and strips risky script behavior while keeping ids/defs intact.
- 2) Compare previewIf the preview changes after cleaning, step back to Normal or disable aggressive options like id removal.
- 3) Clean for your targetFor icons and web apps, light minification helps. For design handoff, keep readability and ids.
- 4) Export and reuseCopy for inline SVG or download to commit to your repo and ship as assets.
What gets removed
The cleaner targets common export bloat and optional risky behaviors. It does not “redesign” your SVG.
- ✓Comments and metadata: XML comments,
<metadata>, RDF blocks, and editor notes. - ✓Editor namespaces: common prefixes from Illustrator/Inkscape that inflate the file and add noise.
- ✓XML/DOCTYPE wrappers: optional removal for cleaner embeds and fewer strict-parser warnings.
- iSafety stripping (optional): removes
<script>,on*handlers, and javascript: URLs. - ✓Whitespace cleanup: trims extra whitespace and optionally lightly minifies markup for smaller output.
What we keep untouched
Rendering relies on references. The safest cleaner avoids touching the parts that frequently break.
- ✓Geometry and shape content (paths, rects, circles, groups)
- ✓Styling that affects rendering: fills, strokes, gradients, patterns, filters
- ✓Reference systems: defs, symbols, clip-paths, masks, and
url(#id)links (unless you choose Aggressive options) - iIf you enable aggressive id/defs removal, verify preview before exporting. That is the #1 cause of “broken” SVGs.
Mode behavior (what each one is for)
Removes comments, obvious metadata, common editor prefixes, and optional XML/DOCTYPE wrappers. Safety stripping removes script behavior. Keeps ids, defs, and structure intact.
Similar to Safe, with more consistent whitespace cleanup for web reuse. Usually the best default for icons and inline SVG in apps.
Maximum reduction. Can remove ids, unused defs, and extra attributes. Use only after confirming the cleaned preview matches the input.
Cleaner vs minifier
Use the SVG cleaner when the file has comments, metadata, editor namespaces, unsafe script behavior, or confusing structural clutter. Use the minifier when the SVG already renders correctly and your main goal is reducing file size for a website, icon set, or app bundle.
The cleaner can still reduce bytes, but its first job is safer, easier-to-review markup. After the cleaned preview looks right, the minifier is a better next step for compact spacing and shipping-size tweaks.
Troubleshooting checklist
You removed ids or defs. Keep ids/defs enabled and avoid aggressive removal on files that use url(#...) references.
Same root cause: broken references. Switch to Safe/Normal and re-run, or disable any option that removes ids.
Ensure the SVG has a valid viewBox. Missing viewBox leads to odd scaling behavior in HTML and React wrappers.
Keep safety stripping on. SVGs can contain script blocks and event handlers. Stripping them reduces risk during preview and embedding.
SVG cleanup workflow
SVG cleaner for safer markup, smaller files, and easier export
Use SVG Cleaner when an SVG has editor metadata, comments, unsafe script-like content, duplicated markup, or extra whitespace that gets in the way of embedding, export, or handoff.
Best for
- svg cleaner, clean svg, optimize svg, and remove SVG metadata searches.
- Web icons, app assets, design-system SVGs, craft files, and SVGs before Base64 or raster export.
- Users who need preview, copy, and download after cleanup.
Settings to try
- Remove metadata, comments, unsafe content, and unneeded markup where supported.
- Preview the cleaned output before copying or downloading.
- Use minifier next if the main goal is file size reduction.
Useful limits
- Cleanup can remove unsafe or unnecessary markup, but it cannot fix every malformed SVG.
- Visual output should be checked after cleaning complex files.
- This route edits SVG markup and does not trace raster images.
Related tools
Need help choosing?
Read the concise workflow, preset, settings, and troubleshooting docs without adding clutter to the converter.
❓FAQ
Does cleaning an SVG change how it looks?+
Safe and Normal usually preserve rendering. Aggressive cleanup can change output if it removes ids, defs, or styling attributes the SVG relies on.
Is this SVG cleaner private?+
Yes. Everything runs in your browser. Your SVG content is not uploaded to a server.
What's safe to remove for icons and logos?+
Comments, metadata, editor namespaces, and XML/DOCTYPE wrappers are usually safe to remove. Be careful removing ids or defs if the SVG uses gradients, masks, clip-paths, masks, symbols, or url(#id) references.
Why strip scripts and event handlers?+
SVG can include <script> blocks, on* event handlers, and JavaScript URLs. Stripping them reduces risk when previewing or embedding SVGs from unknown sources.
Can this remove Inkscape or Illustrator junk?+
Yes. It targets common editor prefixes (like inkscape/sodipodi) and metadata blocks that often bloat exported SVG files.
