SVG Optimizer

Optimize SVG markup size.

FreeNo accountOn your device

Runs in your browser. How to verify

Loading tool…

About this tool

Paste SVG markup and press Run. Comments, the XML prolog, doctype, metadata, editor namespaces and extra whitespace are removed, and the result shows how many bytes you saved.

How to use

1
Step 1
Paste your SVG code.
2
Step 2
Press Run.
3
Step 3
Copy the optimized SVG and check it looks right.

How it works

The optimizer makes text-level cleanups: it deletes comments, metadata, empty attributes and Inkscape or Sketch attributes, collapses whitespace, shortens #aabbcc colours to #abc and trims numbers to three decimals. It does not merge paths or rewrite shapes.

Worked example

Editor export

Input
<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10"><!-- icon --><rect width="10" height="10" fill="#ff0000" /></svg>
Output
<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10"><rect width="10" height="10" fill="#f00"/></svg>
Walkthrough
The comment is removed, spacing is collapsed and the colour is shortened.

Limitations

  • Not as aggressive as SVGO.
  • Trimming decimals is slightly lossy; check detailed art.
  • Text content with long numbers may be shortened.

Questions

Will it change how my SVG looks?
Normally not, but compare before using.
Why did it say a file is required?
That was a bug; paste text now works.
Does it minify paths?
No. It does not rewrite or minify path data.
Is my SVG uploaded?
No. The SVG is optimized in your browser and stays on your device.

Features

  • Text in, text out
  • Removes comments and metadata
  • Byte savings shown
  • Runs in your browser

Related resources

Guides and videos from around the web—opens on YouTube or the publisher’s site.

  • How Image Compression Works

    Leo Isikdogan

    Size limits matter for many file-sharing tools.

    Watch on YouTube
  • Learn JSON - Full Crash Course

    freeCodeCamp.org

    Structured file formats show up beside binary converters.

    Watch on YouTube
  • File API

    MDN

    Browser file handling behind local file tools.

  • MIME types

    MDN

    Content types when converting or renaming downloads.