SVG optimizer

Clean comments, drawing-program settings and spare whitespace from an SVG, compare it before and after, and round its numbers only if you choose.

Privacy: runs in your browser

This tool processes your input in this browser. Inputs and results are excluded from analytics. Draft saving is optional and stays on this device; delete saved text with the draft controls. Loading text from a URL is optional and contacts that server; its URL and your IP address are visible to the server. When a button sends your result to another tool, it waits in this tab until that tool opens it, for up to a minute, and is then deleted.

Copy link includes the inputs you choose to share in the address. Anyone with that link can reopen them. Files and generated results are excluded. Password and key tools share settings only.

Your result

Your SVG before cleaning
Original ·
Your SVG after cleaning
Cleaned ·

Enter your values.

More
Keyboard shortcuts

Sharing and starting over

A copied link includes what you entered and your settings, so anyone with it can see them. Leave private text out. Files and results are not included; random draws are made again.

Start over puts the tool back to its starting values and closes any open file or device. Drafts you saved stay on this device until you delete them.

Using the SVG optimizer

The tool parses the SVG and removes comments, metadata, the settings drawing programs save (Inkscape, Illustrator, Sketch, Figma), the line breaks between tags and empty groups, then serializes what is drawn. Geometry stays exact unless you round numbers to one, two or three decimal places; text spacing stays intact. Scripts, links and external resources are rejected. The gzipped size beside the cleaned file's bytes is what a web server that compresses SVG sends.

Next: Color picker from image

Worked example

The sample icon, saved from Inkscape, keeps its circle and tick exactly while the program's settings, its comment, the metadata block and the line breaks between tags are removed.

Before you rely on the result

This is careful cleanup, not maximum compression: it joins paths and shortens path data only when you choose, and it shortens a colour only where the short form is the same colour (#ffffff to #fff). Scripts, embedded HTML, animation, links and external image or font references are not accepted. Rounding to one decimal place can visibly shift a small icon, so compare the two pictures before you use the file.

Next: Image resizer

Cite this page

ToolOctopus. “SVG optimizer.” Updated . https://tooloctopus.com/svg-optimizer.

Add an access date if your instructions require one.

Citation formatting uses citeproc-js by Frank Bennett and Citation Style Language styles. License and source code.

Find a tool

Type a task, a unit pair, a sum or a time zone. ↓ to choose, Enter to open.