SVG Minifier
Runs in your browser — your text is not sent anywhere to use this tool.
Save this tool
Keep SVG Minifier handy
Use your browser's Share menu, then “Add to Home Screen”.
Strip editor clutter and scripts out of an SVG, without touching the artwork.
- Paste your SVG source, or drop the file's contents in
- Choose how precisely to keep coordinates — two decimals is plenty for an icon
- Minify, check the preview still looks right, then copy or download
Title and description are kept by default — a screen reader reads them out.
About this tool
An SVG exported from Illustrator, Figma or Inkscape carries a lot that has nothing to do with the picture. There is a metadata block naming the document and its author, editor namespaces recording grid and guide settings, a generator comment, and coordinates written to twelve decimal places because that is what the maths produced. On a typical icon that bookkeeping is most of the file, and none of it changes a single pixel. Removing it usually cuts the size by half or more. The other half of the job is not about size at all. SVG is XML, so it can contain script elements and onclick attributes, which is exactly why many sites refuse SVG uploads: a file served from your own domain and opened directly runs its script with your origin's privileges. Script elements, event handlers and dangerous link addresses are removed by default here, so what comes out is safe to serve as a file rather than only safe to embed. Text content and title and description elements are left alone, because those are what a screen reader reads out.
Frequently asked questions
Will minifying change how my icon looks?
It should not. Nothing here restructures the drawing: there is no path merging, no shape conversion and no reordering. The only visible risk is coordinate rounding, which is why the precision is adjustable and there is a preview beside the output. Set it to off if you are working at very large scale.
Why does it remove scripts by default?
Because an SVG can contain them, and a file served from your own domain runs its script with your origin's privileges. That is the reason so many sites reject SVG uploads outright. Removing script elements, event handlers and dangerous link addresses is what makes the output safe to serve directly.
Are the title and description kept?
Yes, unless you ask for them to go. Most minifiers drop them silently, but they are the accessible name and description that a screen reader announces. Removing them saves very little and costs a real thing, so it is a choice rather than a default.
Why is removing unused ids switched off?
Because an id may be referenced from outside the file. References inside it are all checked, but CSS or JavaScript in the page that embeds the SVG cannot be seen from here. The saving is small and the breakage would be invisible, so you have to opt in.
How much smaller will my file get?
For an editor export, usually between forty and seventy per cent, and the figure is shown after every run. A file that has already been minified will barely change, which is the correct outcome rather than a failure.
Help improve this tool
Found a bug, want a change, or need a tool we don't have?
You have an unsent draft.
Thanks — that's with us. You'll find the reply in your inbox.Go to my messages