Saving in percent
g = (o − n) ÷ o × 100
For the Inkscape icon: (365 − 148) ÷ 365 × 100 = 59.5%.
Optimize SVG files locally by removing comments, metadata and editor-specific markup, collapsing whitespace and rounding decimal values.
An SVG exported from Inkscape, Illustrator or Figma often contains more text than drawing: XML declaration, comments, metadata, editor-specific attributes and five-decimal coordinates. This optimizer removes that clutter and rounds the numbers without turning the drawing into a raster image: the file stays vector, readable and editable. Everything happens in your browser.
Paste SVG code or import an .svg file. The XML declaration and DOCTYPE are always removed; a comment placed before the svg tag, common with editors, is accepted. Click Optimize SVG: the result, its preview and three figures appear, original size, optimized size and saving in bytes and percent.
Four options are on by default: remove comments, remove metadata blocks, remove Inkscape and Sodipodi data (inkscape: and sodipodi: attributes and their namespaces) and collapse whitespace between tags. A fifth, off by default, removes width and height from the root svg tag when a viewBox exists; rectangles and images inside keep theirs.
Decimal precision, from 0 to 8 digits (3 by default), rounds the numbers in attribute values: paths, coordinates, viewBox, transforms. Useless zeros disappear (8.00000 becomes 8, 0.5 becomes .5). IDs, classes, links and displayed text are not changed. Copy the code or download optimized.svg.
Paste the code or import a complete .svg file.
Keep the defaults or adjust the decimal precision.
Check the preview and the saving, then copy or download the result.
Sizes are measured in UTF-8 bytes, before and after optimization.
g = (o − n) ÷ o × 100
For the Inkscape icon: (365 − 148) ÷ 365 × 100 = 59.5%.
Slim down icons exported from an editor before embedding them in HTML or a sprite.
Get compact, clean markup to paste into a component or an email.
Shrink the SVG before encoding it in Base64 in a stylesheet.
Default settings. The drawing is identical: only the useless text and the decimals beyond the third are gone.
Input
XML declaration, comment, metadata, inkscape: attributes, path M12.34567 8.00000 L35.65433 8.00000 L24.00000 40.12345 Z — 365 bytesResult
<path d="M12.346 8 L35.654 8 L24 40.123 Z" …> — 148 bytes, 217 bytes saved (59.5%)A 0.05-unit shift is invisible on a 48-unit icon but can distort a detailed plan or map: check the preview.
Input
Same 48 × 48 icon, precision 1Result
M12.3 8 L35.7 8 L24 40.1 Z — 142 bytes (61.1%)Not with the default options on an ordinary drawing. A very low precision can move points slightly: compare with the preview.
No. Hex colours, id, class and links stay intact, as does the text inside text tags.
Comments and metadata, yes. The proprietary attributes removed are those of Inkscape and Sodipodi; other editors' remain.
No. It cleans the code and rounds numbers without rewriting the geometry the way SVGO would.
Yes, it remains a text SVG that any vector or code editor can open.
No. Optimization is done by your browser.
Related tools
Tools similar or complementary to this one.
Convert SVG files to PNG, JPEG or WebP with preview and output settings.
Convert an image to Base64/Data URI and convert Base64 back to an image.
Create a favicon.ico and a site’s PNG icons (16 to 512 px) from one image, in your browser.
Reduce SVG file size by cleaning markup, precision, paths, styles, and metadata while protecting rendering, accessibility, and security.
Learn how SVG describes shapes, uses viewBox, integrates into Web pages, and should be handled for responsiveness, accessibility, and security.
Resize, compress and choose between WebP, AVIF and other formats with a practical workflow that reduces file size without unnecessary visual loss.
Resize a batch of images, convert them to WebP and remove metadata with one reusable Pipeline.