Strip comments, metadata and useless whitespace

Strip comments, metadata and useless whitespace. Built for writers, designers and developers preparing content or an asset before publication.

Strip comments, metadata and useless whitespace. See a clear result update immediately in your browser, with no account, upload or stored data to worry about.

How to use

  1. Paste the source code of your SVG file into the input area, or import the file from your computer.
  2. Start the optimisation so comments, metadata blocks and unnecessary whitespace are removed.
  3. Check that the graphic still looks right after the code has been trimmed.
  4. Copy the resulting SVG into your project while keeping a backup of the original file.

Example

The sample is a small icon that carries a comment and a metadata block. After optimising, compare the size of the code and confirm that the path still renders the same way: the cleanup should lighten the file without altering the drawing.

Input

<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'>
  <!-- icon draft -->
  <metadata>draft</metadata>
  <path d='M4 4 L20 20' fill='none' stroke='black'/>
</svg>

Limits and formats

Where processing happens

The cleaning is done fully in your browser. Your SVG code is never uploaded, shared or stored, so you can refine artwork that has not been published yet without exposing it to anyone.

Frequently asked questions

Does optimisation change colours or dimensions?

No, the tool targets code that the renderer does not need. Drawing attributes are kept in place, but it is still worth opening the result to catch anything unexpected.

Can I optimise an animated SVG?

The cleanup mainly removes comments, metadata and whitespace. If your animation depends on scripts or external stylesheets, review the result carefully before publishing it.

Why is my file still large?

Weight usually comes from the number of points in the paths rather than from comments. To go further you would have to simplify the curves in a vector graphics editor.

Tools in the same category