<!-- Markdown twin of https://pixelvault.dev/tools/svg-optimizer/ -->

Free tool

# SVG Optimizer

Minify and compress SVG files **in your browser** — nothing is uploaded. Powered by SVGO, with a live preview of every result. Download the smaller file or get a link. No signup.

Drag & drop SVG files here

Choose SVG files

SVG · up to 10 MB each · processed on your device

Decimal precision   Keep IDs  Remove scripts

## Need a link to the optimized SVG?

Click **Get a link** on any result above and it appears here, hosted at a short-lived URL. Or drop an SVG straight into the box below.

Drag & drop an image here

or

Choose an image

or paste a screenshot (Ctrl/⌘+V)

SVG · up to 2 MB

## Minify SVG without uploading it

Most online SVG optimizers send your file to a server. This one runs SVGO inside your browser tab, so unreleased logos, client artwork and internal diagrams stay on your device. Drop one SVG or a whole batch, adjust the precision, and download the smaller files.

## What changes, and what doesn't

-   **Removed:** comments, editor metadata, hidden and empty elements, unused definitions and redundant groups.
-   **Rewritten:** path data and numbers, to the decimal precision you set. Three decimals is a safe default for icons and logos; drop to one or two for simple shapes, raise it for large or finely detailed artwork.
-   **Kept:** the viewBox, so the file still scales to any size.
-   **Already small?** If the result is not smaller, you keep your original instead of a bigger file.

## Optimize, then host or convert

An optimized SVG is a good file to put behind a link: [SVG to URL](/tools/svg-to-url/) hosts it as-is. Need a raster copy for an email client or a platform that rejects SVG? Use [SVG to PNG](/tools/svg-to-png/). For JPG, PNG and WebP photos and screenshots, the [image compressor](/tools/image-compressor/) does the same job.

## SVG Optimizer — FAQ

Is my SVG uploaded?

No. The optimizer runs in your browser tab; the file never leaves your device. It is only uploaded if you click "Get a link" on a result, and then only that one optimized file.

How much smaller will my SVG get?

It depends on where the file came from. Exports from Illustrator, Inkscape, Sketch or Figma often shrink by 30-70% because they carry editor metadata, comments, long decimal coordinates and unused definitions. A hand-written or already-minified SVG may barely change, and when the result is not smaller this tool keeps your original instead of handing back a bigger file.

Will it change how my SVG looks?

It is designed not to, but the transformations are real edits: path data is rewritten, numbers are rounded, groups are merged. Lowering the precision shrinks the file further and, past a point, visibly shifts curves. Check the preview on each result before replacing an original, and raise the precision if a shape looks off.

What gets removed?

XML declarations and doctypes, comments, <metadata> elements, Inkscape, Sketch and Illustrator editor namespaces, hidden and empty elements, default attribute values, unused definitions, redundant groups and unnecessary whitespace. Numbers are rounded to the precision you choose, colours are shortened, and path data is rewritten into its most compact form.

Does it keep the viewBox?

Yes. The viewBox is what lets an SVG scale to any size, so it is never removed. Width and height attributes are also left alone.

When should I tick "Keep IDs"?

When something outside the SVG refers to its IDs: a stylesheet, JavaScript, a URL fragment such as icons.svg#home, or another SVG's <use>. By default unused IDs are removed and the rest are shortened, which is safe for a self-contained file and breaks those outside references.

Why are scripts removed?

A hosted SVG opened directly in a browser runs any script inside it, so PixelVault refuses SVGs that contain scripts. By default the optimizer strips <script> elements and on\* event handlers so the result can be hosted. Untick the option if you need an interactive SVG; you can still download it, but "Get a link" will be refused for it.

Can I optimize a whole folder, or do it in CI?

This page runs SVGO 4, the open-source optimizer most SVG tooling is built on, so the same result is available on the command line: npx svgo -f ./icons -o ./icons-min. Use this page for one-off files and checking the preview.
