SVG Optimiser — Minify & Clean SVG Files Online Free | LazyTools

SVG Optimiser

Minify and clean SVG files online — remove metadata, comments, empty groups and unused definitions. See a detailed removal log showing exactly what was stripped, compare before/after in a side-by-side code view, and batch-process multiple files. Free, no upload, 100% private.

Free forever Removal log Batch mode Never uploaded

SVG Optimiser Tool

Drop your SVG file here
SVG files only · Processed locally — never uploaded to any server
Add SVG files above to batch-optimise them all at once
Optimisation passes — toggle what to remove
Before
Upload or paste an SVG to see the original code here
After
Optimisation results will appear here
⭐ User Ratings

Rate this tool

4.8
Based on 112 ratings
5
87
4
16
3
6
2
2
1
1
Was this SVG optimiser helpful?
✅ Thank you for your rating!
✦ Features

Everything in this free online SVG optimiser

The only free SVG optimiser that shows you a detailed removal log — not just a file size reduction percentage, but exactly what was stripped: 4 comments, 2 empty groups, 1 metadata block. Unique on free tools.

Detailed removal log
Every optimisation pass reports exactly what it removed — number of comments, empty groups, metadata blocks, unused defs, redundant attributes. No other free SVG minifier shows this breakdown.
Side-by-side before/after code view
See the original SVG code on the left and the optimised output on the right simultaneously. Switch to Preview mode on either side to verify the SVG still looks correct before downloading.
Selectable optimisation plugin toggles
Turn each optimisation pass on or off independently — remove comments but keep metadata, or skip path precision reduction for complex gradients. Control without a command line.
Batch mode — multiple SVGs at once
Upload an entire icon set or SVG library at once. Every file is optimised and the results — original size, optimised size, saving % — are shown per file. Download all as a ZIP.
Paste SVG code directly
No file to save? Paste raw SVG markup into the Paste Code tab and optimise instantly. The cleaned code appears in the output panel for copy-paste directly into your project or codebase.
Live SVG preview — before and after
Switch to Preview mode on the before or after panel at any time to render the SVG and visually verify that optimisation has not changed its appearance. Critical for complex SVGs with gradients or filters.
100% browser-based — SVGs never uploaded
All optimisation runs in your browser using JavaScript string and XML manipulation. Your SVG files — including proprietary icons, client brand assets and unreleased designs — never leave your device.
Copy or download optimised SVG
Copy the optimised SVG code to clipboard in one click, or download it as a named .svg file — using the original filename with "-optimised" appended. No watermark, no registration required.
📖 How to use

How to optimise an SVG file online — step by step

Upload your SVG or paste the code
Drag and drop your SVG file onto the upload zone, click Choose SVG file to browse, or switch to the Paste code tab and paste your SVG markup directly. For multiple files, use the Batch tab. Nothing is uploaded to any server.
Choose your optimisation passes
All optimisation plugin toggles are enabled by default — this gives maximum file size reduction. If you need to preserve specific data (e.g. keep metadata for licensing, or skip path precision reduction for animated SVGs), toggle off those passes individually before optimising.
Review the removal log and compare code
The Results panel shows the original size, optimised size, and percentage reduction. Below that, the removal log lists every type of data removed with a count. Switch to the Code tab to compare the raw SVG markup, or Preview to visually verify the SVG looks identical.
Copy or download the optimised SVG
Click Copy optimised SVG to copy the cleaned markup to your clipboard — paste directly into your HTML, React component, CSS or build pipeline. Or click Download .svg to save the file. The downloaded filename is your original filename with -optimised appended.
🏆 Why LazyTools

How this SVG optimiser compares to the alternatives

We tested every major free SVG minifier and cleaner. The core optimisation quality is similar across tools (most use SVGO under the hood) — the real differences are in the workflow, transparency and control.

Feature LazyTools ✦ SVGOMG svgoptimizer.com Vecta.io Nano
Optimise SVG file online✔ Yes✔ Yes✔ Yes✔ Yes
Detailed removal log (what was removed)✔ Per-pass counts✘ No✘ No✘ No
Side-by-side before/after code view✔ Yes✔ Yes✘ No✘ No
Live SVG preview (before and after)✔ Both panels✔ Yes✘ No✘ No
Paste SVG code directly✔ Yes✔ Yes✘ No✘ No
Selectable per-pass plugin toggles✔ Yes✔ Yes✘ No✘ No
Batch multiple SVG files at once✔ Yes✘ No✘ No✘ No
No watermark on output✔ Never✔ Yes✔ Yes✘ Free tier adds watermark
100% client-side — no upload to server✔ Always✔ Yes✘ Uploads✘ Cloud-based
No login or account required✔ Yes✔ Yes✔ Yes✘ Account required
📖 Guide

The Complete Guide to SVG Optimisation — What It Removes and Why It Matters

SVG files exported from design tools are almost always larger than they need to be. Illustrator, Figma, Inkscape and Sketch all embed additional data into exported SVG files that makes sense for the authoring environment but is completely unnecessary for browser rendering. Understanding what that data is — and what it's safe to remove — helps you optimise more confidently and debug edge cases when something changes unexpectedly.

What does an SVG optimiser actually remove?

The typical SVG exported from Illustrator or Figma contains several categories of unnecessary data:

XML processing instructions and doctype declarations. SVG embedded directly in HTML does not need an XML declaration (<?xml version="1.0"?>) or doctype. These add bytes with no rendering effect when used inline or as an <img> source.

Editor metadata blocks. Illustrator embeds an extensive <metadata> block containing Dublin Core RDF triples, creation timestamps, Illustrator version data and document settings. Inkscape embeds its own namespace (sodipodi:) with editor-specific attributes. Figma embeds a figma:... namespace. None of this affects rendering.

XML comments. Illustrator often includes layer comments and export notes as XML comments (<!-- Generator: Adobe Illustrator ... -->). These are safe to remove from production SVGs though worth keeping in source-controlled originals.

Empty group elements. Complex Illustrator documents frequently export nested g elements that serve only as layer containers during editing. When those layers have no visible content after flattening, the <g> tags remain in the export with no children. Collapsing or removing these has no visual effect.

Unused definitions. The SVG <defs> block contains reusable elements — gradients, filters, clip paths — that are referenced elsewhere in the file. During editing, elements may be added to <defs> and then removed from the visible artwork without the definition being cleaned up. Unused definitions add bytes with no visual contribution.

Default attribute values. SVG has many attributes that have default values when omitted. For example, fill="black", opacity="1", visibility="visible" — any attribute set to its default value can be safely removed. Design tools frequently include these explicitly for legibility, but browsers know the defaults without being told.

Excessive coordinate precision. Path coordinates exported from vector editors often have 6+ decimal places (M 123.456789 456.123456). At typical web display sizes, coordinates rounded to 2 decimal places are visually indistinguishable. Reducing precision to 2dp can significantly shrink path data, particularly in complex illustrations.

Typical reduction ranges: Simple icon SVGs (single-colour logos, navigation icons): 40–60% reduction. Complex illustrations with many paths: 20–40% reduction. Highly detailed technical SVGs (maps, architectural diagrams): 15–30% reduction. Animated SVGs: 10–20% reduction (many animation attributes must be preserved).

When SVG optimisation is and isn't lossless

Most standard optimisation passes are truly lossless — the rendered output is pixel-identical to the original. However, three specific optimisations deserve caution:

Path precision reduction is technically lossy but practically imperceptible at normal display sizes. At extreme zoom (4000%+), sub-pixel differences may be visible in complex paths with tight curves. For SVGs used at print resolution or in technical diagrams where precision matters, keep precision at 3–4dp rather than the default 2.

Comment removal is fully lossless visually, but may remove licensing information embedded as XML comments. If your SVG uses a Creative Commons or other open-source licence that requires attribution to be preserved, either keep comments enabled or ensure the attribution exists somewhere else in your project.

Metadata removal removes Dublin Core and XMP metadata blocks. This has no visual effect, but if your SVG is part of a document management system that reads SVG metadata for cataloguing, keep this pass disabled.

SVG optimisation in web performance

SVG optimisation contributes to web performance in two ways. First, directly: a smaller SVG file takes less time to transfer over the network, particularly noticeable on mobile connections. Second, indirectly: a smaller SVG DOM has fewer nodes for the browser to parse and lay out. Complex SVGs with thousands of path elements can contribute to parsing jank even after transfer — reducing the node count through group collapsing helps here.

SVG files can be additionally compressed with gzip or Brotli at the server level (since they are text-based XML), which typically achieves another 60–80% reduction on top of the optimised size. This is separate from and additional to the optimisation this tool performs. If your web server serves SVGs with Content-Encoding: gzip, the gzip benefit applies to the already-optimised file — so running optimisation before gzip compounds both savings.

SVG optimisation vs SVG conversion to PNG/WebP

SVG and raster formats (PNG, WebP) serve different purposes. SVG should be used for vector graphics — icons, logos, illustrations, charts — where scalability matters. Converting to PNG or WebP makes sense only when the SVG contains complex filter effects or gradients that are slow to render, or when you need a fixed-size image for a specific raster context.

For most icon and logo use cases, an optimised SVG will be smaller than an equivalent PNG at the same visual quality at 2× density, while remaining infinitely scalable. An optimised SVG icon at 200 bytes will look perfectly sharp on a 4K display; an equivalent PNG at 64×64 pixels would need to be 128×128 for Retina and still shows pixelation at larger sizes.

Frequently asked questions

SVG files exported from design tools like Illustrator, Figma and Inkscape contain large amounts of unnecessary data — editor metadata, XML comments, empty groups, redundant attributes and unused definitions. SVG optimisation removes this data without affecting the visual appearance, typically reducing file size by 40–80%. Smaller SVGs load faster and parse faster in the browser.
With default settings, no — the standard optimisation passes are lossless and have no visual effect. Path precision reduction (rounding coordinates) is technically lossy but practically imperceptible at normal web display sizes. Use the before/after preview in this tool to visually compare the original and optimised SVG before downloading. If you notice any visual difference, disable the path precision pass and re-optimise.
This tool implements SVGO-compatible optimisation passes in pure JavaScript — comment removal, metadata stripping, empty group collapsing, unused definition removal, default attribute removal and coordinate precision reduction. These are the same passes SVGO runs by default and cover 90%+ of the file size savings achievable. All processing runs in your browser with no server upload.
No. This SVG optimiser runs entirely in your browser using JavaScript. Your SVG files are never uploaded to LazyTools or any server. This is especially important for proprietary icon sets, client brand assets and unreleased design files — they stay on your device throughout the process.
Typical results: simple icon SVGs (40–60% reduction), complex illustrations (20–40%), highly detailed technical SVGs (15–30%), animated SVGs (10–20%). The highest savings come from SVGs exported from Illustrator which embed extensive metadata. SVGs exported from Figma are already leaner and see smaller but still meaningful reductions of 15–35%.
Yes — always optimise first. SVG optimisation and server-level gzip/Brotli compression are complementary and compound each other. Optimisation removes redundant data; gzip compresses what remains. An already-optimised SVG typically compresses even better under gzip because repeated patterns are more concentrated. Running both typically achieves 70–90% total size reduction from the original exported SVG.
🔗 Related tools

More free image and developer tools