An SVG exported from Figma, Illustrator, or Inkscape typically carries a lot of data the shape itself doesn't need — an XML declaration, editor-specific namespace tags, <title>/<desc>/<metadata> blocks, comments left by the design tool, and id/data-* attributes used internally by the editor. None of it changes how the SVG renders; all of it adds to file size. InstantTools SVG Optimizer strips exactly that layer of cruft using a set of text-pattern rules, then shows you the byte-size difference. If the icon you're optimizing conveys information or sits against text, its fill color is still subject to the same accessibility contrast rules as any other element — see WCAG Contrast Ratios Explained.
What this tool actually does
Paste your SVG markup into the editor and click "Optimize SVG." The tool runs a fixed sequence of text replacements over the markup — it is a pattern-stripping tool, not a full SVG parser or a wrapper around SVGO (the industry-standard SVG optimization library). Concretely, it removes:
- The
<?xml ... ?>declaration and any<!DOCTYPE ...>line <metadata>,<title>, and<desc>blocks (and their contents)- HTML/XML comments (
<!-- ... -->) - Editor namespace declarations for Inkscape, Sodipodi,
dc,cc,rdf, Sketch, and Illustrator, plus any<inkscape:...>/<sodipodi:...>tags (thexlinknamespace is kept — it's a real SVG/XML namespace, not editor metadata) - Every
data-*="..."attribute, and anyid="..."attribute that isn't actually referenced elsewhere in the file - Redundant whitespace between tags
Before stripping an id, the tool scans the rest of the file for url(#that-id), href="#that-id", or xlink:href="#that-id" — gradients, clipPath, mask, filter, and <use> elements all rely on an id staying intact, and removing it would leave a dangling reference that breaks the rendered shape. Only truly unreferenced ids get removed.
That's the complete list. It does not round coordinate precision (e.g. 1.00001 → 1), does not remove default/redundant attributes like fill="black", does not merge or simplify path segments, and does not touch <defs>/empty group elements. If your file's bloat is mostly high-precision path data rather than editor metadata, expect a smaller reduction than a real path-optimizing tool like SVGO would give you.
Paste-only — no file upload
This tool works from pasted markup only; there's no drag-and-drop or file picker here. Open your .svg file in a text editor (or your browser, via "View Source" on the exported file), copy the markup, and paste it into the left panel.
Why do this locally instead of uploading?
The regex-based cleanup runs entirely in your browser's memory the moment you click "Optimize SVG" — nothing is sent anywhere. For SVGs that embed proprietary iconography or unreleased brand assets, that matters more than it sounds: many free "SVG optimizer" sites are wrappers around a server-side SVGO call, meaning your file's markup transits their server first.
How to optimize an SVG
- Paste your SVG markup into the left panel.
- Click "Optimize SVG."
- Compare the before/after byte count, then copy the cleaned markup or download it as a
.svgfile.
Common use cases
- Stripping Figma/Illustrator/Inkscape export bloat (namespaces, ids, comments) before committing an icon to a codebase
- Cleaning embedded SVG icons for email clients, several of which mishandle unrecognized namespace attributes
- Quick sanity check on how much of an SVG's size is editor metadata vs. actual path data
FAQ
Does this use SVGO?
No. It's a set of regex-based text replacements covering XML declarations, editor metadata, comments, and id/data attributes — not a full SVG parser and not SVGO. It won't round coordinate precision or simplify path geometry the way SVGO's plugins do.
Will this change how my SVG looks?
No — every rule here only removes content that has zero effect on rendering (metadata, comments, ids, namespace declarations, whitespace). Nothing that touches path/d geometry is modified.
How much size reduction should I expect?
It varies a lot by source tool. Files with heavy Inkscape/Sodipodi metadata often shrink noticeably; a file that's already lean (e.g. hand-written or previously optimized) will see a small reduction, since there's little metadata left to strip.
Can I upload a file instead of pasting?
Not currently — this tool is paste-only. Copy the SVG markup from your file (a text editor or your browser's "View Source" both work) and paste it into the input panel.
Is there a "safe" vs "aggressive" mode?
No — there's a single fixed set of rules applied every time you click "Optimize SVG." If you need path-simplification-level compression, run the output through a dedicated tool like SVGO afterward.