SVG Tools

SVG Optimizer

Make SVG files smaller with the open-source SVGO optimizer. Compare the preview and file size before and after, then download or copy the result.

Drop an SVG file here

Processed in your browser. Files are never uploaded.

This tool uses the open-source SVGO optimizer in your browser. Nothing is uploaded. Open VectorCraft

How to Optimize an SVG

  1. 1

    Open an SVG, paste code or try the sample.

  2. 2

    Adjust coordinate precision and choose whether to keep titles; compare the previews.

  3. 3

    Download or copy the optimized SVG.

Example

A design-tool export contains comments, redundant attributes and long decimal coordinates. Compare its actual size before and after optimization; savings depend on the file and settings.

Start conservatively with coordinate precision

The SVG optimizer uses SVGO in your browser. It can shorten path commands, remove redundant markup and reduce numeric precision. Keep the default precision for a first comparison. Reducing the number of decimal places can save bytes, but a coordinate rounded too far can move a small feature or change a thin curve. Inspect fine details as well as the overall silhouette.

Compare the actual before and after byte sizes for your own document. An SVG that is already optimized may save little or nothing; savings are not a fixed percentage. Pretty printing adds whitespace for readability, so its output can be larger than minified output. Choose compact output for delivery and formatted output when someone needs to read or edit the source.

Preserve meaning and verify the destination

The default settings retain viewBox and keep title and description elements. These elements can carry meaningful labels; removing them solely to reduce a few bytes may be the wrong tradeoff. The keep-titles control lets you choose, but surrounding HTML and the way an image is embedded also influence accessibility. Do not assume optimization alone makes an image accessible.

Use the before and after previews to check shapes, gradients and clipping, then open the downloaded file in its intended destination. Optimization can change IDs or structure, so check any external CSS, scripts or animation that relies on those details. Keep your original design source and use the optimized copy as a delivery asset. This tool compresses SVG markup; it does not convert the file to PNG or promise lossless behavior at every precision setting.

An SVG optimizer checklist for a delivery asset

Begin with a finished SVG and keep its editable source. Open it in the SVG optimizer using the default settings. Compare the original and optimized previews, then read both byte sizes. Look closely at thin outlines, corners, gradient transitions and clipped shapes. If you lower precision, repeat the comparison after each change. Stop reducing precision when a detail moves or disappears; a smaller file is useful only if it still does the job.

Use compact output for a web image and pretty printing when someone needs readable markup. Keep titles when they contain a meaningful label, and verify the image in its final page. The optimizer preserves viewBox, but your destination still determines the displayed width and height. External styles or scripts that target specific IDs require a separate check because optimization may alter document structure. Do not use a delivery copy as your only editable master.

If optimization reports an error, check that the file is complete SVG markup with correctly closed tags and quoted attributes. Try the sample to confirm that the tool runs in your browser, then compare your source with a known working export. Already compact files can show little saving or even a larger output with pretty printing enabled. This SVG compressor reports your actual result; it does not promise a reduction for every file. Download the accepted copy and reopen it before replacing an existing asset.

What It Does and Current Limits

  • Removes comments, editor metadata and unused definitions, and shortens paths and numbers.
  • viewBox is always kept, so the image scales the same way.
  • Lower precision gives smaller files but can shift tiny details; check the preview.

SVG Optimizer FAQ

Is this lossless?

Default settings keep the shapes visually identical in most files. Very low precision can change small details.

Is my file uploaded?

No. SVGO runs in your browser.