Free · No sign-up · Runs in browser

SVG Optimizer

Minify SVG files for the web — strip editor metadata (Inkscape, Illustrator), shorten hex colors, round long decimals, and collapse whitespace. Live preview and size readout. 100% client-side.

SVG Input
Example icon Hand-drawn example
Input preview
Optimized SVG
// Optimized SVG will appear here…

About the SVG Optimizer

This free online SVG optimizer shrinks SVG files for the web by stripping editor metadata, shortening colors, rounding numbers, and collapsing whitespace. SVGs exported from Inkscape, Figma, Illustrator, and Sketch regularly carry 30–60% of bytes that no browser ever uses — this tool removes them.

What Gets Removed

  • XML declaration and DOCTYPE (inline SVGs don't need them)
  • Comments (<!-- -->) and <metadata>, <title>, <desc> blocks
  • Inkscape, Sodipodi, Illustrator-specific namespaces and attributes
  • xmlns:dc, xmlns:cc, xmlns:rdf declarations
  • Trailing zeros on long decimals (32.000000 → 32)
  • 6-digit hex colors reducible to 3-digit (#ffffff → #fff)
  • Redundant whitespace between tags

What Stays Intact

The optimizer avoids transformations that can change rendering: <defs>, <style>, <linearGradient>, <mask>, and <filter> elements are preserved. Element IDs are kept because external CSS and JavaScript may reference them.

Common Use Cases

  • Shrink hero and marketing-page SVGs for faster page loads
  • Prepare icons for inline SVG sprites in React/Vue/Svelte components
  • Clean up logos exported from Figma or Illustrator
  • Reduce bundle size in Next.js, SvelteKit, and Astro projects
  • Minimize SVGs embedded as data URIs in CSS

Frequently Asked Questions

How much smaller will my SVGs get?

Exports from vector editors typically shrink 30–70%. Hand-written SVGs are already lean and will see 5–15% savings. The exact number is shown in the Saved readout after each run.

Does rounding break small icons?

Two decimal places are enough for icons from 16×16 to 2048×2048. Drop to 0 or 1 decimal for larger savings on simple shapes; raise to 3–4 for tightly curved paths where precision matters.

Is my SVG uploaded anywhere?

No. Parsing, rewriting, and preview all happen in your browser — safe for brand assets and unreleased designs.

Related Tools

Minify JSON, format SQL, or convert Markdown to HTML.

Live preview

Side-by-side preview of input and optimized SVG so you can spot regressions.

Big savings

30–70% smaller output on editor-exported SVGs, with configurable aggressiveness.

Fully private

Parsing and rewriting are local — safe for brand assets and unreleased designs.