Skip to content

SVG Optimizer

Minify and clean SVG markup to reduce file size while preserving visual quality. Remove metadata, comments, editor data, and optimize colors, paths, and IDs with configurable precision.

Updated

What is the SVG Optimizer?

How it works

Examples

Clean up a bloated icon export

<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated by Figma -->
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" version="1.1">
  <metadata>
    <rdf:RDF>
      <cc:Work>
        <dc:title>Search Icon</dc:title>
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <title>Search</title>
  <path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5z" fill="#000000" stroke="none" stroke-width="1" fill-rule="evenodd"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5z" fill="#000"/></svg>

Minify colors and round path data

<svg viewBox="0 0 100 100">
  <circle cx="50" cy="50" r="40" fill="rgb(255, 0, 0)"/>
  <rect x="10" y="10" width="80" height="80" fill="#00ff00" stroke="rgba(0, 0, 255, 1)" stroke-width="2.500000"/>
  <path d="M 10.123456, 10.123456 L 90.876543, 90.876543" stroke="hsl(240, 100%, 50%)"/>
</svg>
<svg viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="#f00"/><rect x="10" y="10" width="80" height="80" fill="#0f0" stroke="#00f" stroke-width="2.5"/><path d="M10.123,10.123L90.877,90.877" stroke="#00f"/></svg>

Convert shapes to paths and merge

<svg viewBox="0 0 100 100">
  <g fill="none" stroke="#000">
    <line x1="0" y1="0" x2="50" y2="50"/>
    <line x1="50" y1="50" x2="100" y2="0"/>
  </g>
  <circle cx="50" cy="50" r="20" fill="#000"/>
</svg>
<svg viewBox="0 0 100 100"><path fill="none" stroke="#000" d="M0,0L50,50 M50,50L100,0"/><path d="M30,50a20,20 0 1,0 40,0a20,20 0 1,0 -40,0" fill="#000"/></svg>

Clean up IDs and remove hidden elements

<svg viewBox="0 0 100 100">
  <defs>
    <linearGradient id="myVeryLongGradientName" x1="0" y1="0" x2="1" y2="1">
      <stop offset="0%" stop-color="#fff"/>
      <stop offset="100%" stop-color="#000"/>
    </linearGradient>
    <clipPath id="unusedClipPath">
      <rect width="10" height="10"/>
    </clipPath>
  </defs>
  <rect width="100" height="100" fill="url(#myVeryLongGradientName)"/>
  <rect width="100" height="100" fill="red" display="none"/>
</svg>
<svg viewBox="0 0 100 100"><defs><linearGradient id="a" x1="0" y1="0" x2="1" y2="1"><stop offset="0%" stop-color="#fff"/><stop offset="100%" stop-color="#000"/></linearGradient></defs><rect width="100" height="100" fill="url(#a)"/></svg>

Frequently asked questions