Free Online SVG Optimizer
The SVG Optimizer cleans up and minifies SVG markup by removing comments, metadata, editor cruft, and unnecessary attributes. Smaller SVG files load faster and are easier to embed inline.
The optimised result can be embedded with the SVG to Base64 Converter or rasterised with the SVG to PNG Converter. To review the colours it uses, the Color Palette Extractor is the tool.
How to use the SVG Optimizer
- 1 Paste the SVG markup, or drop an `.svg` file.
- 2 Inspect the findings: this shows what the optimiser intends to remove before it does anything.
- 3 Apply the clean-up. Editor metadata, comments, empty groups and default-valued attributes are stripped, and coordinates are rounded.
- 4 Copy the result or download it, then check the image still renders as expected.
Where SVG weight comes from
An icon exported from a design tool is often five to ten times larger than it needs to be. The path data is the irreducible core; everything around it is packaging. Stripping that packaging is safe because it affects presentation, not meaning — a renderer draws the same picture whether or not the `<metadata>` block is present.
The single biggest win is usually the removal of editor-specific namespaces and the `<defs>` blocks that a tool emitted but that nothing references. On icon sets this routinely halves the file, which matters a great deal when every icon is inlined into a page.
- Remove `<metadata>`, `<title>` when unused, comments and editor namespaces.
- Drop groups with no transform and only one child.
- Remove attributes set to their default values, such as `fill="none"` on a root that already defaults to it.
- Convert `<path>` commands to their shortest absolute or relative equivalent.
- Never strip `viewBox`, `width` or `height` if the layout depends on them.
Why optimize SVG?
Exported SVGs often carry editor metadata and comments that add kilobytes without changing how the artwork looks. Removing them reduces transfer size and keeps inline SVGs tidy.
Frequently asked questions
What is actually taking up the space in an unoptimised SVG?
Usually three things. Editor metadata from Illustrator, Figma or Inkscape, which records the application name, a timestamp and often a full layer tree that nothing renders. Precision, where coordinates are stored as `123.456789` when `123.46` is visually identical. And redundancy — groups wrapping a single element, and attributes set to the value they already default to.
Is rounding coordinates ever visible?
Occasionally, on very detailed artwork viewed at large size. Rounding to two decimals is invisible for essentially any drawing that will be displayed at ordinary scale. If a path looks subtly wrong after optimising, the precision setting was too aggressive for that file — restore the original and use a lighter pass.
Can optimising break an animation or a script?
It can, which is why the tool reports what it is about to remove. If the SVG contains `<animate>` elements, event handlers or `<script>` tags, those are functional rather than decorative and stripping them changes behaviour. Check the preview after every pass on an animated file rather than trusting the size saving.
Related Image & Color Tools
You might also need
Tools from other categories that people pair with the SVG Optimizer: