How to minify svg and reduce file size in seconds
- Step 1Open the SVG minifier — Load the tool above. There is nothing to install — it runs as in-browser JavaScript. Unlike running the SVGO CLI, you don't need Node, a config file, or a terminal.
- Step 2Drop the file or paste the source — Drag one
.svgonto the drop zone, click to browse, or paste the raw SVG XML into the Or paste SVG source code box. Pasted source is validated first — if it doesn't parse as an<svg>root, you getInvalid SVG — could not parse the pasted content as valid SVG XMLbefore any work runs. - Step 3Run the minifier — Click run. The pass is deterministic and fixed — there are no checkboxes or sliders to set. The same input always produces the same output, which makes it safe to diff in version control.
- Step 4Read the size metrics — The result panel reports Size reduction (percent), Original (formatted bytes), and Minified (formatted bytes). A typical Figma or Illustrator export shows 40–70%; an already-clean hand-written icon may show only a few percent because there was little metadata to remove.
- Step 5Copy or download the output — Copy the minified string to paste inline into HTML/JSX, or download it as
<name>-minified.svg. The download keeps your original filename stem and adds the-minifiedsuffix so you don't overwrite the source. - Step 6Chain a deeper pass if you need more — Minify removes metadata only. For smaller path data, run the output through svg-precision-tuner to round coordinates, or svg-path-simplifier to drop redundant polyline nodes. To see the gzip/brotli wire size, drop it on svg-compression-estimator.
Exactly what the minify pass removes
The minifier applies this fixed sequence of text transforms — nothing more, nothing less. There are no options. Each row maps a transform to what it deletes and why it is safe.
| Transform | Removes | Why it is rendering-safe |
|---|---|---|
| Comment strip | Every <!-- ... --> block (including multi-line generator banners) | XML comments are never rendered; browsers discard them |
| Inter-tag whitespace collapse | Spaces/newlines/tabs between a > and the next < | Whitespace between element tags is not significant for SVG layout |
| XML declaration strip | The leading <?xml version="1.0" encoding="..."?> | Ignored when the SVG is used inline or via <img>; UTF-8 is the default |
| Editor namespace strip | xmlns:dc, xmlns:cc, xmlns:rdf, xmlns:sodipodi, xmlns:inkscape | These declare metadata vocabularies no browser renders |
| xmlns:xlink strip (conditional) | xmlns:xlink — only when no xlink: attribute remains in the document | Keeps the declaration if any xlink:href still uses it, so the doc stays well-formed |
| xmlns:svg strip | The redundant xmlns:svg="..." redeclaration on the root | The root already carries the default xmlns, so this prefix is redundant |
| Empty-element collapse | <tag></tag> → <tag/> for any element with no children | Self-closing and explicit-empty forms are equivalent in XML |
| Empty-attribute strip | Any attr="" with an empty value | Empty attribute strings carry no value and are export noise |
Per-tier file size and what the limit means
Free tier processes one SVG up to 5 MB per run. Larger tiers raise the per-file ceiling. Vector files this large are rare — the limits exist for machine-generated or auto-traced monsters.
| Tier | Max SVG per run | Notes |
|---|---|---|
| Free | 5 MB | One file per run; paste or drop |
| Pro | 50 MB | Same single-pass minify; larger ceiling |
| Pro + Media | 200 MB | For pathological auto-traced files |
| Developer | 2 GB | Practical ceiling is browser/runner memory |
| Enterprise | Unlimited | No configured byte cap |
Cookbook
Real before/after snippets from typical editor exports. Each shows the input, the minifier's output, and the byte change. Whitespace is shown literally so you can see what gets collapsed.
An Illustrator export with a generator comment
Illustrator prepends an XML prolog and a multi-line generator comment, then pretty-prints. The minifier removes all three categories in one pass.
Before (412 bytes): <?xml version="1.0" encoding="UTF-8"?> <!-- Generator: Adobe Illustrator 27.0, SVG Export Plug-In --> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <path d="M3 12h18" stroke="#111"/> </svg> After (94 bytes, ~77% smaller): <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 12h18" stroke="#111"/></svg>
An Inkscape file full of editor namespaces
Inkscape declares sodipodi, inkscape, dc, cc, and rdf namespaces on the root. The minifier strips all of them unconditionally because nothing renders them.
Before:
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
viewBox="0 0 32 32">
<circle cx="16" cy="16" r="10"/>
</svg>
After:
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><circle cx="16" cy="16" r="10"/></svg>Empty groups and empty attributes
Exports often leave behind empty <g> wrappers and empty attribute strings. The minifier folds and strips both.
Before: <svg xmlns="http://www.w3.org/2000/svg" id="" viewBox="0 0 10 10"> <g></g> <rect x="1" y="1" width="8" height="8" class=""/> </svg> After: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10"><g/><rect x="1" y="1" width="8" height="8"/></svg>
xlink kept because it is still in use
The minifier only drops xmlns:xlink when nothing references it. Here a <use xlink:href> still needs the declaration, so it is preserved.
Before: <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 20 20"> <defs><circle id="d" r="4"/></defs> <use xlink:href="#d" x="10" y="10"/> </svg> After (xmlns:xlink retained — still referenced): <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 20 20"><defs><circle id="d" r="4"/></defs><use xlink:href="#d" x="10" y="10"/></svg>
What it leaves alone: title, desc, and coordinates
Minify is metadata-and-whitespace only. Accessibility elements and numeric precision are deliberately untouched so you don't lose screen-reader text or shape fidelity.
Before: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <title>Search</title> <desc>Magnifying glass icon</desc> <path d="M15.5000 14.0000 a6 6 0 1 0-1.5 1.5"/> </svg> After (title/desc/coords preserved, only whitespace removed): <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>Search</title><desc>Magnifying glass icon</desc><path d="M15.5000 14.0000 a6 6 0 1 0-1.5 1.5"/></svg> → To trim the 15.5000 coordinates, run svg-precision-tuner next.
Edge cases and what actually happens
Pasted text is not valid SVG
InvalidPasted source is parsed before processing. If the root element is not <svg> or the XML fails to parse, the tool returns Invalid SVG — could not parse the pasted content as valid SVG XML and does nothing. Fix the source (often a stray copied character or a truncated paste) and try again.
File exceeds your tier's byte limit
413 too largeThe browser checks size before running: free is 5 MB, Pro 50 MB, higher tiers 2 GB. Over the limit you get File "x.svg" exceeds the <tier> tier per-job limit. Most vector icons are kilobytes; hitting this usually means an embedded raster <image> base64 blob or an auto-traced photo path — minify won't shrink raster payloads.
`<title>` and `<desc>` are kept
PreservedMinify removes comments, not accessibility elements. <title> (the accessible name) and <desc> survive intact — by design, because stripping them would hurt screen-reader users. If you specifically want them gone, use svg-metadata-scrubber, which targets metadata elements.
Coordinates keep their full precision
By designd="M15.5000 14.0000" stays exactly as written — minify never rounds numbers. Coordinate precision is the single biggest lever on path-data size, so it lives in svg-precision-tuner where you choose the decimal places (0–4).
Unused `<defs>` are left in place
Out of scopeA gradient or filter defined in <defs> but never referenced is not removed by minify — only empty <defs></defs> get folded to <defs/>. To prune dead definitions safely, run svg-unused-defs-purger.
Inline CSS inside `<style>` blocks
PreservedThe minifier does not minify CSS inside <style> elements (it only collapses whitespace between element tags, not inside text content). Selectors, declarations, and class names are kept verbatim, so styled SVGs render identically.
Already-minified input
ExpectedRunning minify on an already-clean file is safe and idempotent — there's just little to remove, so the size-reduction percent will be near zero. The output is byte-stable, so re-minifying in CI never produces churn in your diffs.
Significant whitespace in a text node
PreservedOnly whitespace strictly between a > and the next < is collapsed. Whitespace inside a <text> content node (e.g. between words) is not touched, so multi-word labels keep their spacing.
Frequently asked questions
How much smaller will my SVG get?
Editor exports (Illustrator, Figma, Inkscape, Sketch) typically drop 40–70% because they carry comments, a generator banner, pretty-print indentation, and editor namespaces. A hand-written or already-optimised icon may shrink only a few percent — there's simply less metadata to strip. The result panel shows the exact original, minified, and percent figures for your file.
Does minification change how the SVG looks?
No. The pass only removes non-rendering content: comments, inter-tag whitespace, the XML prolog, editor-only namespaces, empty elements, and empty attribute strings. It never alters geometry, colours, transforms, or text. The rendered output is pixel-identical.
Is this actually SVGO?
No. Despite the "Pro-Minifier" name, this tool is a focused set of safe text transforms, not the SVGO plugin pipeline. It does the high-value, zero-risk removals (comments, whitespace, editor metadata, empty elements) without SVGO's more aggressive plugins that can occasionally alter rendering. If you want SVGO-style number rounding or path collapsing, use svg-precision-tuner and svg-path-simplifier as targeted follow-up steps.
Are there any options or settings?
No. The minifier runs one fixed, deterministic pass with no checkboxes or sliders. This is intentional — it makes the output reproducible (great for CI diffs) and means there's no way to accidentally enable a risky transform. The companion tools expose options where a choice actually matters (decimal places, tolerance, etc.).
Will it remove my `<title>` and `<desc>` accessibility text?
No. Minify keeps <title> and <desc> so screen readers still announce your icons correctly. It only removes XML comments, not accessibility elements. If you deliberately want to drop metadata elements, use svg-metadata-scrubber.
Does it round or shorten coordinate numbers?
No — number precision is untouched. Coordinate rounding is the job of svg-precision-tuner, where you pick 0–4 decimal places. Minify first to strip metadata, then tune precision for the biggest path-data savings.
Can I paste SVG code instead of uploading a file?
Yes. Use the "Or paste SVG source code" box. The paste is validated as well-formed SVG before processing — if it doesn't parse with an <svg> root you get a clear error and nothing is changed.
What's the largest file I can minify?
5 MB on free, 50 MB on Pro, and 2 GB on higher tiers per run. Vector icons are almost always kilobytes, so you'll rarely approach these. If you do hit it, the file likely contains an embedded base64 raster <image> — minify won't compress raster data; re-export the icon as true vector instead.
Is my file uploaded to a server?
No. The minify pass runs entirely in your browser as JavaScript — the SVG bytes never leave your machine. Only an anonymous "tool ran" counter is recorded for signed-in dashboard stats; the file content is never sent or stored.
Why is xmlns:xlink still in my output?
Because something still uses it. The minifier drops xmlns:xlink only when no xlink: attribute (like xlink:href on a <use>) remains, otherwise the document would become ill-formed. Modern SVG can use plain href instead of xlink:href; switch those references first and a re-run will then drop the declaration.
What does the downloaded file get named?
Your original filename stem plus a -minified suffix — e.g. logo.svg downloads as logo-minified.svg. That keeps the original safe and makes the optimised copy easy to spot.
How do I see the gzipped wire size?
The minified bytes the tool reports are the uncompressed size. Servers usually serve SVG with gzip or brotli, which compresses text heavily. Drop the minified file on svg-compression-estimator to see the real over-the-wire gzip and brotli sizes.
Privacy first
Every JAD SVG tool runs entirely in your browser using the DOM API and Canvas. Your SVG files never leave your device — verified by zero outbound network requests during processing.