Why an Icon From a Design Tool Is 40KB
By toolbelt maintainers ·
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?
How much is usually saved?
Does it affect accessibility?
Does it render the output?
Related tools
- Base64 ImagePreview a base64 image and turn it back into a data URI, or drop in an image file to encode it. Detects PNG, JPEG, GIF, WebP and BMP from the bytes themselves.
- JSON ValidatorValidate JSON syntax with detailed error messages. Catch trailing commas, missing brackets, and syntax errors instantly before sending payloads to your API.
- JSON FormatterBeautify, validate, minify, and view JSON. Format messy API responses into readable code or compress it to save bandwidth, running safely in your browser.
- JSON MinifierCompress JSON to a single line. Remove all unnecessary whitespace and line breaks to reduce payload size for production APIs without altering the underlying data.