SVG optimizer and minifier
MEMBERSSee where every byte of an SVG goes, choose what may be taken out, and check that the picture stays the same.
Canvas
Canvas
The code cannot be read. The canvas shows the last version that could.
Fill
Stroke
Text
Place and size
Effects
Nothing is selected. These are the properties of the drawing.
Drawing
Press an element to select it, arrows move it, Delete removes it, Ctrl D copies it. V selects, A edits points, P is the pen, R a rectangle, O an ellipse, T a text. Layers hold every element for the keyboard.
Code, live both ways
Code, live both ways
Weight
What the file weighs
All optimizations
Found a bug or missing something? Write to us
How it works
Every byte is accounted for
The bar is the file: solid parts stay, striped parts go, and their widths are bytes. Paths, colours and structure are what remains; editor data, comments, decimals, defaults and white space are what programs leave behind.
Paths are rewritten in their shortest form, relative or absolute, whichever is shorter for each command, and every point is rounded from its true place so errors do not add up along a path.
Both versions are drawn at several times their size and compared pixel by pixel. If rounding becomes visible the tool says how many pixels differ, and one more decimal is usually enough.
Help
FAQ
How many decimals should an optimized SVG keep?
Decimals runs from 0 to 4 and starts at 2, for paths, points and lengths. Opacities and gradient offsets keep at least two and transforms at least three, since a small error there fades or moves a whole element. The pixel comparison shows when a lower value starts to change the picture.
What is removed as editor data?
Elements and attributes with the prefix of a drawing program, such as inkscape: or sodipodi:, the declarations of their namespaces, metadata, and the attributes data-name, data-layer and data-lock. The xlink and xml prefixes stay, because the browser still uses them.
Can optimizing make a file larger?
No. The passes run one after another, each on the result of the one before, and a pass that would make the code longer or unreadable is skipped. The result is saved as name.min.svg, and Use the optimized code puts it in the editor, where undo brings the old code back.