SVG Optimizer
An SVG saved from Inkscape, Illustrator, Figma or Sketch carries the editor's own bookkeeping — layer names, guide positions, RDF licence blocks, coordinates to six decimal places. This page runs SVGO, the standard SVG optimiser, on your file without it leaving the browser, and shows the result next to the original so you can see that nothing visible changed.
SVG Optimizer
Paste the markup or drop a file and the optimised version appears on the right, with the byte count before and after and both versions rendered underneath. Drop several files at once and each is optimised with the same settings; the table lists every file's saving, and Download all packs them into one zip.
How to use it
- Paste SVG markup, or drop one or more
.svgfiles on the left pane. - Compare the two renderings. The captions give the size each one renders at; if they differ, the status line says so.
- Adjust the options — every change re-runs the optimisation.
- Copy the result, download it, or download all files as a zip.
What the optimiser does
It runs SVGO's default preset, a fixed sequence of 34 plugins. Among them: removing the doctype, the XML declaration, comments, <metadata> and editor namespaces; collapsing useless groups; turning simple shapes into shorter path data; rewriting path commands in their shortest relative or absolute form; rounding numbers; shortening colours; merging adjacent paths with identical styles; and dropping attributes that only restate a default.
- Multipass — runs the preset again on its own output until the file stops getting smaller. One plugin's change often opens up another's.
- Precision — decimal places kept in coordinates and transforms. SVGO's own default is 3. Lower values save more bytes and, on a small icon drawn in a large coordinate space, can visibly shift curves — check the preview.
- Keep viewBox — on by default. SVGO 4 no longer removes
viewBoxin its default preset; untick this to add theremoveViewBoxplugin, which drops it only when it is exactly0 0 width height. Without aviewBoxthe graphic no longer scales when CSS resizes it. - Keep IDs — turns off
cleanupIds, which deletes IDs nothing references and shortens the rest toa,b,c. Keep them when JavaScript, CSS outside the file, or a<use href="sprite.svg#icon">elsewhere refers to them by name. - Keep classes — turns off
inlineStyles, which copies a<style>rule that matches a single element into that element'sstyleattribute and then deletes the class it no longer needs. - Remove metadata / comments / editor data — on by default. Editor data means elements and attributes in the namespaces of Inkscape and Sodipodi, Adobe Illustrator, Sketch, Figma, Krita, Serif, Boxy SVG and Visio, plus the RDF, Dublin Core and Creative Commons namespaces used for embedded licence blocks.
- Prettify — indents the output two spaces per level. Larger, but readable in a diff.
The preview is safe to look at
An SVG file can contain <script> and event handlers, so a file from someone else is never inserted into this page. Both previews are ordinary <img> elements pointed at a temporary blob: URL — an SVG loaded as an image is not allowed to run scripts or load other resources. That is also why the preview can differ from how the same file looks when opened directly, if it depends on an external font or image.
What it will not do
- It does not rasterise or trace anything — the output is still vector SVG.
- It does not remove
<title>, which screen readers announce, or a<desc>you wrote: SVGO's default only drops a<desc>that is empty or starts with Created with / Created using. - It does not gzip. A web server that compresses SVG on the way out shrinks it further; the numbers here are for the uncompressed file.
FAQ
Is this the same SVGO as the command-line tool?
Yes — the svgo npm package's own browser build, version 4.1.0, loaded from jsDelivr. The default settings match npx svgo file.svg except multipass, which is switched on here.
Why did my icon change size after optimising?
Almost always a removed viewBox, or width/height that only made sense together with it. Keep keep viewBox ticked. The captions under the previews report the rendered size of both versions so you can see it immediately.
My CSS animation stopped working.
The animation probably targets an ID or a class that SVGO renamed or removed. Tick keep IDs and keep classes.
Is my file uploaded?
No. The SVGO library is downloaded once from cdn.jsdelivr.net; your files are read and optimised locally and never sent anywhere.
Related tools
- XML Formatter — pretty-print an SVG to read its structure
- XML Minifier — whitespace-only minification for any XML
- XML Tree Viewer — browse the element tree of a large SVG
- Namespace remover — strip prefixes from any XML document
- XML Validator — check that an SVG is well-formed
Privacy
100% client-side. Files are optimised in your browser; nothing is uploaded. See the privacy policy.