SVG Optimizer

Shrink an SVG by removing the XML header, comments, editor metadata and extra whitespace, and rounding long decimals in paths and coordinates.

Processed on your device. Files are not uploaded

How to minify an SVG

  1. Paste your SVG

    Paste or type it into the box, or press Try an example.

  2. Set the precision

    Fewer decimal places make a smaller file.

  3. Keep or drop the title

    Title and desc help screen readers, so keep them unless the SVG is decorative.

  4. Copy or download

    Save the output as a .svg file.

Worked example

This is what SVG Optimizer gives for its own sample values. Open the tool above and change anything to try your own.

SVG

<?xml version="1.0" encoding="UTF-8"?>
<!-- Generator: Illustrator -->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24.000 24.000" data-name="icon">
  <title>Heart</title>
  <metadata>editor data</metadata>
  <path d="M12.000 21.350L10.550 20.030C5.400 15.360 2.000 12.280 2.000 8.500 2.000 5.420 4.420 3.000 7.500 3.000" fill="none" stroke="#000"/>
</svg>
Decimal places to keep
2
Remove <title> and <desc>
No

Minified

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>Heart</title><path d="M12 21.35L10.55 20.03C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3" fill="none" stroke="#000"/></svg>

About SVG Optimizer

Make an SVG smaller by removing the XML header, comments, editor metadata (Inkscape and Sodipodi), data attributes and extra whitespace, and by rounding long decimals in paths and coordinates. The size saved is shown.

FAQs

Will the image look the same?

Yes at the default of 2 decimals for icons. For very large or detailed drawings, raise the precision.

Should I remove the title?

Keep <title> and <desc> if the image conveys meaning, because screen readers use them.

Can I turn the SVG into a picture?

Use SVG to PNG.

Related tools