SVG Optimizer & Code Minifier

Remove editor metadata, strip empty groups, and reduce coordinate precision to shrink SVG file size locally.

Paste Raw SVG Code or Upload File
Optimization Options
Embed this tool on your website / blog No code required · Copy and paste
HTML Embed Code (iframe):
<iframe src="https://lucentool.com/svg-optimizer" width="100%" height="650" style="border:1px solid #e5e0d8;border-radius:12px;max-width:850px;width:100%;" frameborder="0"></iframe>
<div style="font-size:12px;color:#78716c;margin-top:6px;font-family:sans-serif;">Powered by <a href="https://lucentool.com/svg-optimizer" target="_blank" style="color:#c85a32;text-decoration:none;">Lucentool - SVG Optimizer & Code Minifier</a></div>

Why design tools export larger SVGs

Tools like Figma, Illustrator, and Sketch often include editor-specific namespaces, layer metadata, and coordinate numbers with 6 or more decimal places. Browsers only need the actual shape elements and styles to render the graphic.

Coordinate precision

For most web icons and illustrations, 2 decimal places are plenty. Truncating coordinates from numbers like 142.847192 to 142.85 reduces character count and improves compression under Gzip or Brotli.

Client-side processing

Optimization runs directly in your browser using DOMParser and regular expressions. Your SVG files and code are not uploaded.

Formats, sizes and other limits

runOptimization() parses the file with DOMParser, then walks the tree: optimizeSvgCode() strips the XML declaration, doctype, editor metadata and comments, removes empty groups, and roundCoords() rewrites numeric attributes to a fixed number of decimals by multiplying, rounding and dividing, which is where most of the size reduction comes from on machine-generated files. formatBytes() reports the before and after sizes so the saving is measured, not assumed.

Where it stops working

This is a structural slimmer, not a full optimiser: it does not merge paths, convert shapes to path data, or run anything like SVGO's geometry passes, so the savings are smaller than a dedicated tool would achieve. Rounding coordinates is lossy — at one decimal a small icon may visibly shift — and the preview is a rendering, not a guarantee that every downstream consumer will accept the reduced markup. An SVG that relies on embedded scripts or external references may be reduced into something that no longer works.

Privacy: nothing is uploaded

The SVG is parsed with the browser’s own DOM parser on your device. The file is never uploaded, which matters for client work you are not free to share.

Frequently asked questions

How much smaller will my file get?

Typically 10–30% on editor-exported files, mostly from metadata and coordinate rounding. Machine-optimised files barely change.

Can rounding break my icon?

It can. On a 24-pixel icon, one decimal place is usually safe; on detailed illustrations, reduce precision more cautiously and compare the preview.

Does it merge paths or shapes?

No. That requires geometry analysis; this tool removes what is clearly disposable and rounds numbers.