File4Edit

SVG optimizer

Optimize and minify an SVG file by removing editor metadata, comments, unused IDs and extra decimals, free and in your browser with no upload. The original and optimized versions render side by side so you can check nothing moved.

Strips editor metadata, collapses whitespace and rounds coordinates. The rendered result is unchanged.

In detail

The SVG optimizer shrinks an SVG by removing what cannot affect the drawing: editor metadata, XML comments, empty attributes and groups, unused IDs, whitespace between tags, and extra decimal places in coordinates. It never touches pixels: the markup is parsed into a tree, cleaned and written back out as text.

Both versions are drawn side by side so you can see that nothing moved, and the before and after sizes are shown with the percentage saved. IDs are dropped only when nothing refers to them, and every ID is kept if the file contains a script. Rounding to very few decimals is the one setting that can visibly change a drawing, and the tool warns at zero.

SVG optimizer at a glance

Input
SVG files or pasted SVG markup
Output
An optimized .min.svg file, or the markup copied
What it does
  • Removes editor metadata and comments
  • Drops unused IDs safely
  • Rounds coordinates to 0 to 6 decimals
  • A side-by-side render check
  • Before and after byte counts
Who it is for
Web developers and designers exporting icons and illustrations from Figma, Illustrator or Inkscape.
Limits
  • An already minified SVG may not get smaller, and the tool says so.
  • Removing title and desc can hurt accessibility, and the tool warns.
Privacy
Runs entirely in your browser: the file is never uploaded, and nothing is kept after you close the tab.

How to optimize an SVG file

  1. Drop an SVG Drop or browse for an .svg file, or paste the markup from the clipboard. Raster images are refused with a message saying so — this tool reads SVG markup, not pixels.
  2. Set the decimals The Decimals slider keeps between 0 and 6 decimal places in coordinates, paths, transforms and the viewBox. Two is safe for screen graphics; at zero every coordinate snaps to a whole unit and the tool tells you to check the render.
  3. Choose what to strip Four toggles cover metadata (<metadata>, <title> and <desc>), XML comments, whitespace between tags, and unused ids. Each one re-runs the optimization as you change it.
  4. Check the render and the list The Render panel draws the original and the optimized markup next to each other, and the Removed list names exactly what came out and how many of each — comments, editor attributes, empty groups, unused ids, long numbers.
  5. Take the result Copy optimized source puts the markup on the clipboard, and Download optimized SVG saves it alongside your original as a .min.svg file.

SVG optimizer: common questions

Will optimizing change how my SVG looks?

That is the rule the tool is built around. Ids are only dropped after every reference in the document has been collected, whitespace inside <text> and similar elements is left alone, an empty xmlns is never treated as an empty attribute, and attribute entities are never decoded. The only setting that can visibly change a drawing is rounding coordinates to very few decimals, and the tool warns you at zero.

Does it remove ids my JavaScript or CSS depends on?

No. Before any id is dropped, the tool collects every reference in the document — url(#id), href="#id", aria attributes, SMIL begin and end timings, and anything inside a <style> block. And if the file contains a <script> element at all, every id is kept, because a script can look an element up by a name the optimizer cannot see.

What if my SVG is already minified?

Then the output may come out the same size or slightly larger, and the tool says so and tells you to keep the original rather than quietly handing you a worse file. It also warns when stripping metadata removed a <title> or <desc>, since screen readers announce those and an SVG that is content rather than decoration should keep them.