SVG Optimizer
Optimize SVG markup size.
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
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?
Why did it say a file is required?
Does it minify paths?
Is my SVG uploaded?
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 YouTubeLearn 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.