ToolJutsu
All tools
Developer Tools

SVG Optimizer

Optimise and shrink SVG file size.

Optimisation options

XML comments, <metadata> and editor-specific attributes are always removed. Toggles above control the lossy steps that can drop information you might want to keep.

0 B
Tip: press Ctrl/ + Enter
Processed on your device. We never see your files.

How to use SVG Optimizer

What this tool does

This SVG optimizer takes the raw markup of an SVG file and rewrites it as a smaller, cleaner version that renders identically. SVGs exported from design tools are usually padded with material that no browser needs: editor metadata, XML comments, namespaced bookkeeping attributes, empty groups, and coordinates printed to six or more decimal places. The tool parses your SVG with the browser’s native DOMParser, walks the element tree, removes that cruft, and serializes the result compactly. It then shows you the before and after byte size and the percentage saved. Everything happens on your device — the SVG is never sent anywhere.

Why you might need it

Smaller SVGs load faster, and on an icon-heavy page the saving adds up across dozens of files. An SVG straight out of Illustrator, Figma, Inkscape or Sketch often carries hundreds of bytes of editor-specific noise that serves no purpose once the file ships. Inline SVGs embedded directly in HTML benefit even more, because every redundant byte is parsed and stored on every page view. Cleaning the markup also makes it far easier to read and edit by hand: once the inkscape:* and sodipodi:* attributes are gone, the actual shapes are no longer buried.

How to use it

  1. Paste your SVG markup into the input box, or drop a .svg file onto it.
  2. Review the optimisation options. <desc> removal and number rounding are on by default; <title> removal is off to preserve accessibility.
  3. If you keep number rounding on, pick a precision — 2 places is a safe default for most artwork.
  4. Click Optimise SVG, or press Ctrl/Cmd + Enter.
  5. Check the before/after sizes, then copy the result or download it as a .svg file.

Common pitfalls

The most important toggle to think about is <title>. A <title> element is the accessible name of the graphic — screen readers announce it. If your SVG is decorative, removing the title is fine; if it conveys meaning, keep it. Number rounding is the other thing to watch. At precision 2 or higher the visual change is imperceptible, but rounding to 0 decimal places on a path with fine curves can visibly distort it. If a shape looks wrong after optimising, raise the precision and try again. Finally, the tool needs well-formed XML: if you paste a fragment with an unclosed tag or a stray <, you will get a clear parse error rather than a broken file.

Tips and advanced use

For the smallest possible output, leave rounding on and choose the lowest precision that still looks correct — test by opening the downloaded file. If you maintain an icon set, run each icon through once after exporting; the editor attributes are removed every time regardless of the toggle settings, so even a default run is worthwhile. When you embed SVGs inline in components, optimise first so your HTML stays lean. And because the whole process is client-side, this is a safe step for unreleased brand assets and confidential diagrams — nothing about your file leaves the browser tab.

Frequently asked questions

Is my SVG uploaded anywhere?
No. The SVG is parsed, cleaned and re-serialized entirely inside your browser using the built-in DOMParser. There is no server involved, so you can safely optimise logos or artwork that you have not published yet.
What exactly does the optimiser remove?
It always strips XML comments, the metadata element, and editor-specific namespaces and attributes such as inkscape and sodipodi. Behind toggles it can also remove title and desc elements, round numbers to fewer decimal places, and drop empty groups and empty attributes.
Will optimising change how my SVG looks?
The default settings are visually lossless — they only remove data that browsers ignore when rendering. Rounding numbers is technically lossy: at a high precision the change is invisible, but rounding aggressively on a large detailed path can shift points slightly.
Why should I keep the title element?
The title element is read by screen readers and acts as accessible naming for the graphic. If your SVG is meaningful content rather than decoration, leave 'Remove title' switched off so assistive technology can still describe it.
My SVG shows an error — what went wrong?
The tool reports an error when the markup is not well-formed XML: an unclosed tag, a stray angle bracket, or mismatched nesting. Fix the reported issue, or re-export the file from your editor, then paste it again.

Related tools