Skip to content
gohacks.dev
Web

SVG Optimiser

Shrink an SVG by removing metadata, comments, editor attributes and auto-generated ids, converting styles to attributes and rounding coordinates, with a preview.

Free · No sign-up · Your inputs stay in your browser

Input

Optimise an SVG

Output

Optimised SVG

0 characters

Removes what design tools leave behind (XML declaration, comments, metadata, Inkscape and Sketch attributes, auto-generated ids, empty groups), turns style attributes into presentation attributes and rounds coordinates. Two decimals is plenty for icons drawn on a 24-unit grid; keep more for large illustrations. currentColor lets an icon take its colour from the surrounding text, and dark mode with it. SVGO does all this and more in a build step.

Runs in this browser. Nothing you paste is sent to a server.

Where the bytes come from

Design tools save their own editing state in exported SVGs: layer names, guides, generator comments and coordinates with eight decimal places. For an icon drawn on a 24-unit grid, two decimals are invisible and often halve the file. Build pipelines use SVGO for the same job with more transformations.

currentColor for icons

An icon whose fill is currentColor takes the text colour of its parent, so it follows hover states and dark mode with no extra CSS. Inline SVG is needed for that; an img tag cannot inherit colour.

Share

Frequently asked questions

Is it safe to remove the title element?
title gives an inline SVG an accessible name. Keep it for meaningful images; remove it for decorative icons that have aria-hidden or a label elsewhere.
Will rounding change how the SVG looks?
At two decimals on icon-sized artwork, no. Large illustrations scaled up may need three or four.
Is what I paste sent anywhere?
No. The tool runs entirely in your browser with JavaScript. Nothing you type or paste is sent to our server or stored.

Keep planning

Similar tools