Skip to content
toolbelt
Back to Guides

Why an Icon From a Design Tool Is 40KB

By ·

Updated

Design tools save SVGs for editing, not for the web. Most of the bytes are metadata nobody needs.

What is this tool?

An SVG is XML describing shapes. Because it is text, it carries everything the editor wanted: layer names, private namespaces, comments and metadata.

How it works

I strip comments, the XML declaration, metadata, title and description elements, and private editor namespaces, then collapse whitespace. Optionally I round coordinates. The output is compared to the input so you can see the saving.

Example

<!-- Created with Inkscape -->
<svg xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" …>

becomes

<svg xmlns="http://www.w3.org/2000/svg" …>

When to use it

Before committing an icon set. When a logo from a design tool is hundreds of kilobytes. When a large SVG is blocking render because it is inlined.

Optimization Tips

Rounding coordinates is the one option that can change rendering, so preview after enabling it. And keep the metadata option off if the SVG is also the source file in version control — optimise the build copy.

Frequently Asked Questions

Can this break the graphic?
Not the removals. Rounding is the only option with any visual risk.
How much is usually saved?
Simple icons often shrink by a third. Complex artwork less, because path data dominates.
Does it affect accessibility?
Removing title and description removes the accessible name. Keep them if the graphic conveys meaning.
Does it render the output?
No, it works on markup only.

Ready to try it out?

Put this knowledge into practice with our free tool.

Go to Tool

Related tools