🖼️ Image Tools

SVG Optimizer & Minifier

Clean up SVGs exported from Illustrator, Figma or Inkscape — smaller files, same look.

  • 30–60%typical saving
  • Editor junkremoved
  • Decimalscontrol
  • Previewbefore / after
Original—
Optimized—
Saved—

How to use the SVG Optimizer

  1. 1

    Add an SVG

    Drop a file or paste the code.

  2. 2

    Choose clean-up options

    Metadata, editor data, title/desc and unused IDs.

  3. 3

    Set decimals

    2 is safe for most icons; raise it if detail shifts.

  4. 4

    Compare and save

    Check the previews, then copy or download.

Features

Removes metadata

Comments, XML declarations and metadata blocks.

Removes editor data

Inkscape, Sodipodi, Illustrator and Sketch attributes.

Rounds numbers

Fewer decimals, smaller files.

Unused IDs

Optional removal.

Visual preview

Before and after side by side.

Private

Artwork never leaves your computer.

Who uses it — and for what

Web developers

Lighter inline icons.

Designers

Clean exports from Figma or Illustrator.

Icon libraries

Smaller icon sets.

Email builders

Smaller graphics.

What gets removed

  • XML declarations, comments and <metadata> blocks.
  • Editor namespaces and attributes from Inkscape, Sodipodi, Illustrator and Sketch, which browsers ignore.
  • Excess decimal places in geometry (paths, points, transforms, sizes) — 60.000000 becomes 60 and 50.123456 becomes 50.12 at 2 decimals.
  • Whitespace between tags and empty groups.
  • Optionally titles/descriptions and IDs that nothing references.

Exported SVGs often shrink by 30–60%, which speeds up websites that inline icons and illustrations.

Check the preview

Too few decimals can make detailed artwork wobble — compare the before and after previews and raise the decimals if anything shifts. Keep <title> when the SVG is meaningful content, as screen readers use it for accessibility. For bigger optimisation pipelines developers use SVGO; this tool is a quick, safe clean-up that runs entirely in your browser, so confidential artwork never leaves your computer.

Accessibility

Keep <title> for SVGs that carry meaning (like a chart or a logo used as a link), because screen readers announce it. Decorative icons can drop it and use aria-hidden="true" in your HTML instead.

Choosing decimals from the viewBox and display size

The precision you need depends on how many screen pixels one SVG unit covers. The largest error rounding can cause is half of the last kept digit: 0.5 units at 0 decimals, 0.05 at 1, 0.005 at 2. Multiply by (display size ÷ viewBox size) to get the error in pixels. Small viewBoxes drawn large — a 24-unit icon blown up to 512 px for a hero graphic — need more decimals; large viewBoxes drawn small can use fewer. Only geometry attributes are rounded — path data, points, transforms, viewBox, sizes and coordinates — never namespaces, links, IDs or CSS, and a space is added wherever compact path data needs one, so neighbouring numbers never merge.

What this optimizer does not do

Deep optimisers such as SVGO also rewrite path commands into shorter relative forms, merge paths, shorten colours like #ffffff to #fff, drop default attribute values and collapse unnecessary groups. This tool sticks to safe text clean-up: removing comments, metadata and editor namespaces, rounding numbers and squeezing whitespace. If your web server gzips or Brotli-compresses SVGs, the real download saving is smaller than the raw percentage shown, but cleaner files still help, especially when icons are inlined in HTML.

About “Remove unused IDs”: an ID counts as used only when the file refers to it through url(#…) or href="#…". IDs targeted by a <style> block, your page CSS or JavaScript are not detected, so leave this option off for such files.

Worked examples

An icon exported from Illustrator

A 6 KB export often drops to 2–3 KB after removing editor data and rounding to 2 decimals — with no visible change.

Rounding the sample icon

At the default 2 decimals, the sample’s numbers change like this: 60.000000 → 60, 50.123456 → 50.12, 62.500000 → 62.5, 82.125000 → 82.13, 45.875000 → 45.88, 8.000000 → 8. At 1 decimal the same values become 50.1, 82.1 and 45.9 — still invisible differences on a 120-unit icon.

How many decimals a 24-unit icon needs

On an icon with viewBox="0 0 24 24" shown at 48 px, one unit is 2 screen pixels. Rounding to 1 decimal moves a point by at most 0.05 units — 0.1 px, far below what anyone can see. A 1000-unit illustration shown 100 px wide can even use 0 decimals, because 0.5 units is only 0.05 px.

Pro tips

  • Compare previews at large zoom before saving.
  • Use 3 decimals for detailed illustrations or maps.
  • Convert to PNG afterwards with SVG to PNG if needed.
  • After downloading, drag the file into a new browser tab to confirm it displays on its own before replacing the original.
  • Uploaded files download with “.min” added to the name; pasted code downloads as optimized.svg.

Glossary

Minify
Remove unnecessary characters without changing behaviour.
Namespace
A prefix that marks editor-specific data in SVG.
SVGO
A popular command-line SVG optimiser.
viewBox
The SVG’s internal coordinate system, which is scaled to whatever size the image is displayed at.
Path data
The string of commands and numbers in a d attribute that draws a shape.

Frequently asked questions

Will optimization change how my SVG looks?

Normally no; if it does, increase the number of decimals.

How much smaller will it get?

Typically 30–60% for files exported from design tools.

Should I remove the title?

Keep it for accessibility if the SVG conveys information.

Does it optimise paths?

It rounds numbers and removes junk; for deep path optimisation use SVGO.

Is it safe for animations?

Keep IDs if your CSS or JavaScript references them.

Why did my animated SVG stop working after removing IDs?

The animation’s CSS or script probably targets those IDs. Turn off “Remove unused IDs” and optimise again.

Is a smaller number of decimals always better?

No. Pick the fewest decimals that keep the preview identical; tiny icons drawn large need more precision.

Found it useful? Share the SVG Optimizer:

Last updated 2026-11-28 · Built by Vinayak Agarwal · Part of Image Tools (36 tools)