SVG Optimizer

Minify SVG — strip comments, metadata and editor cruft, and collapse whitespace.

Your SVG is optimized locally in your browser and nothing is uploaded to a server.

Need to shrink raster images too? Try the Image Optimizer.

About SVG Optimizer

This SVG optimizer minifies SVG markup so your icons and graphics ship smaller and load faster. Paste an SVG exported from Figma, Illustrator, Inkscape, or Sketch and the tool strips the XML prolog, doctype, comments, metadata, and editor-specific cruft from Inkscape, Sodipodi, and Adobe, then collapses whitespace to shave bytes. You can optionally drop the root width and height attributes so the viewBox keeps the graphic fully scalable for responsive layouts. It is a handy, lightweight SVGO alternative for front-end developers, designers, and anyone who needs to minify SVG or inline icons into HTML, CSS, or React components. Everything is processed locally in your browser, and the tool reports the before and after byte count so you can see exactly how much smaller your file got.

Features

How to use the SVG Optimizer

  1. Paste your SVG source into the input box.
  2. Toggle the options for comments, metadata, editor data, dimensions, and whitespace to fit your needs.
  3. Read the optimized output and the byte savings shown above it.
  4. Copy the optimized SVG and drop it into your project.

Example

Input

<?xml version="1.0"?>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
  <!-- heart icon -->
  <title>heart</title>
  <path d="M12 21 4 13a4 4 0 1 1 8-5 4 4 0 1 1 8 5z"/>
</svg>

Output

<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12 21 4 13a4 4 0 1 1 8-5 4 4 0 1 1 8 5z"/></svg>

Prolog, comment, and title removed with whitespace collapsed.

Common errors & troubleshooting

Frequently asked questions

What is the SVG Optimizer and what does it remove?
It is an in-browser SVG minifier that strips the XML prolog, doctype, comments, metadata, title and desc, and editor cruft from tools like Inkscape, Sodipodi, and Adobe, then collapses whitespace. You control each step with toggles.
How do I minify an SVG with this tool?
Paste your SVG markup into the input box, toggle the cleanups you want, then copy the optimized output. The byte count and percentage saved appear above the result so you can confirm the shrink.
Will optimizing change how my SVG looks?
No, the default settings only remove non-visual data and whitespace. Visual paths and shapes are preserved, so the rendered graphic stays identical.
Should I remove the width and height attributes?
Drop them only if your SVG has a viewBox. The viewBox keeps the graphic scalable, which is ideal for responsive and CSS-sized icons.
How is the SVG Optimizer different from SVGO?
It is a lightweight, dependency-free optimizer that covers the most common SVGO cleanups in the browser, without installing a build tool or Node setup.
Is my SVG uploaded anywhere?
No. The SVG Optimizer processes your markup locally in your browser, so your data never leaves your device and nothing is uploaded to a server.

Related tools

All ArrayKit tools