Skip to content
Tesserae

Keyboard shortcuts

Focus search
/
This help dialog
?
Run the current tool
Ctrl/⌘ +Enter
Copy the output (when an output is focused)
Ctrl/⌘ +C

Shortcuts are ignored while you are typing in an input, a textarea or a select.

Web & CSS

SVG Optimizer

Paste an SVG (for example straight out of a vector editor) and get a leaner version. Runs entirely on your device. Minify mode produces a single-line document with collapsed whitespace; pretty mode re-indents it to 2 spaces. Numeric attributes are rounded to a configurable precision, XML comments and truly empty <g> groups can be stripped, and no colour values, paths or other meaning are changed — only the document is re-serialized. The size before and after is reported so you can see what changed.

On-device No network Offline-ready

🔒 100% Client-Side & Private — processed locally in your browser. Files never leave your device.

Try:

Options

Your result will appear here

Type or paste your input above, adjust the options, then press Run. Tip: press Ctrl+Enter to run, and ? for every shortcut.

How it works

What minify and pretty really change

Minify collapses whitespace between tags and emits the whole document on one line; pretty reindents it at two spaces per level. Neither reorders attributes nor rewrites path data — the difference is serialization only, and the reported before/after size shows exactly what the whitespace removal saved you.

Rounding numbers without touching colours

“Decimal precision” rounds standalone numeric tokens inside attribute values — coordinates in d, x, y, width, plus transform matrices — to between 0 and 6 decimals. Hex colours such as #fff, rgb() triples, identifiers and unit-suffixed values are recognised and skipped, so geometry tidies up without a fill silently shifting.

Comments and empty groups

“Remove comments” deletes XML comments, the annotations vector editors leave behind, while “Remove empty <g> elements” strips groups with no drawable children. Groups carrying attributes or real content are kept, so structure that affects rendering survives the pass intact.

Loud failure on broken input

If the opening <svg> element is missing or the tags are unbalanced the optimizer reports an error instead of emitting a broken file, and anything beyond two million characters is refused. Parsing and re-serialization both happen in the browser, so the artwork you paste is never uploaded.

Questions

Does it change how the SVG looks?

No. Only the serialization changes: whitespace between tags, comments (when enabled), empty <g> groups and numeric precision. Colours, paths and attribute values keep their meaning. "none" fills and stroke remain untouched.

What does rounding do to attributes?

Numeric tokens in attribute values (geometry, transform matrices that are present, coordinates) are rounded to the chosen precision. Colour values (hex like #fff or rgb(...)), identifiers and unit suffixes are left alone.

Is minified output safe to inline in HTML?

Yes — a single-line SVG is generally the most bandwidth-friendly for inlining. If any browser parser has issues with your exact file you can switch to pretty mode for a readable diff first.

Does it handle malformed SVG?

It reports a clear error if the opening <svg> element is missing or tags are unbalanced, rather than emitting a broken document.

See category