🧹 SVG Optimizer
SVGO in your browser: paste an SVG, get it minified with safe defaults, see the rendered result and the exact bytes saved.
About the SVG Optimizer
Design tools export SVGs meant for re-editing, not shipping: editor metadata, layer names, hidden groups, seven-decimal coordinates. SVGO — the standard optimiser the whole ecosystem builds on — strips all of it while preserving how the image renders. This page runs SVGO entirely in your browser, loaded on demand, with a rendered before-you-commit preview.
The defaults are deliberately safer than SVGO's own: viewBox is kept so CSS scaling keeps working, and IDs are preserved because external stylesheets and scripts may reference them. Both toggles are there when you know your file better.
How to use it
- Paste SVG markup or drop a
.svgfile anywhere on the panes. - Read the verdict bar — exact bytes in, bytes out, percentage saved.
- Check the rendered preview; if something visual broke, flip Pretty-print on and diff the two panes.
- Copy or download the optimised file.
Frequently Asked Questions
What does SVGO actually remove?
Editor metadata (Inkscape, Illustrator and Figma all embed their own), comments, hidden elements, default-value attributes, needless precision in path coordinates, and empty groups. For hand-drawn or design-tool exports, 40–70% savings are normal — vector editors optimise for editing, not for shipping.
Is optimisation safe? Will my SVG look different?
The default preset is SVGO's curated safe set, and this tool keeps viewBox (which the raw preset removes) so CSS scaling keeps working. The one genuinely unsafe toggle — cleaning up IDs — is off by default because external CSS or JS may reference them. Compare the preview panes before downloading; that is what they are for.
Why keep the viewBox?
Without a viewBox, an SVG has no intrinsic coordinate system to scale from — width/height in CSS stops working proportionally and the image renders at a fixed size. SVGO removes it by default for maximum byte savings; this tool overrides that because a broken responsive logo costs more than the ~20 bytes.
Does my SVG get uploaded for optimisation?
No — SVGO runs as JavaScript in your browser (it is loaded on demand the first time you optimise). Your file, which for many teams is unreleased brand or product artwork, never leaves the page.
Why is the preview sanitised?
SVG is a full XML format that can carry <script> elements and event handlers — rendering an untrusted one raw would execute whatever it carries. The preview passes through DOMPurify's SVG profile first. The optimised OUTPUT text is untouched; sanitisation applies only to what this page renders.
Should I optimise SVGs at build time instead?
Yes, if you have a build: vite-plugin-svgo or SVGO's CLI make it automatic. This page is for everything outside the pipeline — a logo somebody emailed, an icon from a designer's export, a one-off graphic — where you want the bytes and a diff you can eyeball right now.