What the SVG Optimizer does
Design tools export SVGs for editing, not for the web. A typical Illustrator, Figma or Inkscape export carries XML
comments, editor namespaces (inkscape:, sodipodi:, data-name), metadata blocks,
empty groups, unused definitions and coordinates with eight decimal places. None of it affects how the image renders,
and together it is usually 40–70 % of the file. The optimizer strips it, rounds coordinates to the precision you choose,
collapses redundant structure and re-serialises the file with minimal whitespace.
It runs SVGO 4 — the same engine bundled with most front-end build tools — compiled to run inside your browser. Files are read by your browser, processed in a background thread, and offered back as downloads; nothing is sent anywhere. You can drop a single file, select a folder, or paste SVG markup straight from another tab.
Choosing a level
- Safe removes only things that cannot change rendering: comments, metadata, editor attributes, unused
defs, hidden elements, and excess numeric precision. Shapes stay shapes, groups stay groups, styles stay where they are. Use it for illustrations or anything you will edit again. - Balanced is SVGO's default preset with two changes: the viewBox is always kept, and ids and titles are
preserved. It merges adjacent paths, converts
rect/circleto paths where smaller, moves shared attributes to groups and inlines simple styles. Output is visually identical in practice. This is the right choice for icons and web assets. - Aggressive additionally removes ids, classes,
data-*attributes, titles and descriptions, embedded raster images and scripts, and drops precision to two decimals. Use it for icon sets you will not target with CSS or JavaScript.
Options explained
- Precision — decimal places kept for coordinates. Three is invisible at any normal size; two is fine for icons under 100 px; one starts to show on curves.
- Keep ids — leave
idattributes in place. Needed if CSS, JavaScript or<use href="#…">references them. - Keep title/desc — preserve the accessible name. Keep this on for inline SVGs that carry meaning; off for decorative icons.
- Remove width/height — strip the fixed pixel size so the SVG scales to its container. The viewBox provides the aspect ratio. Recommended for icons used in HTML/CSS.
- Pretty print — indent the output for reading instead of minifying it. Slightly larger files.
What it will not do
It does not rasterise, recolour, resize or redraw anything — see SVG to PNG and SVG Color Changer for those. It does not fix broken SVGs: a file that fails to parse is reported as failed and left alone. And it never removes the viewBox, so an optimised icon scales exactly as the original did.