All tools

SVG optimizer

Optimize and minify SVG files online for free. Compare vector previews, preserve viewBox, and export smaller SVG or React components. No uploads required.

Your files stay on your device
SVG optimizerLOCAL · SVGO

Your next result starts here.

Drop an SVG here. Everything stays on this device.

Drop one static SVG · up to 2 MB · or paste markup below
Original vector
Preview appears after optimization
Optimized vector
Preview appears after optimization

Paste SVG code or drop a file to begin.

The details behind the tool

Smaller markup. The same coordinate system.

An SVG is a small graphics program expressed as XML: shapes, paths, paint definitions, and a coordinate system combine to describe a picture. Exporters often add editor settings, verbose numbers, redundant groups, and comments that a browser does not need to draw the result. This optimizer uses SVGO in a local Web Worker to simplify that representation. It does not upload your illustration or turn it into a bitmap. Compare both previews and keep the original before replacing a production asset.

What optimization changes

SVGO performs structural and numeric transformations. It can shorten path commands, normalize equivalent attributes, merge compatible shapes, remove redundant properties, and simplify containers. Metadata removal also strips XML processing instructions, document types, and comments. These changes reduce the encoded SVG markup, although the amount saved depends on the input. A hand-tuned icon may already be smaller than a freshly optimized candidate. The size panel reports actual UTF-8 bytes and honestly labels a larger result instead of inventing savings.

The coordinate precision slider controls the decimal precision used by optimization passes, from one to five places. Fewer decimals usually shorten paths but can alter closely spaced points, small lettering, or delicate clipping boundaries. More precision retains finer numeric detail at a possible byte cost. Multipass asks SVGO to repeat its work when another pass can improve the result. Neither setting proves visual equivalence: inspect tiny features, gradients, strokes, and text at the sizes used in your interface.

Preserve viewBox and integration contracts

The viewBox connects the drawing's internal coordinates to its displayed viewport. Removing it can break responsive scaling even when an image appears correct at its exported width and height. This tool leaves the viewBox-removal plugin disabled and preserves a source viewBox. Changing coordinate precision is separate from changing that viewport contract. An SVG without a viewBox does not gain one automatically; check the original coordinate system before making that asset responsive in a component or stylesheet.

IDs can be referenced by gradients and clipping paths inside the file, but they can also be targeted by external CSS, links, or JavaScript. The clean-ID pass is therefore off initially. Turn it on only when those outside references are not part of your integration. Internal references are updated by the optimizer, while external files cannot be inspected here. Collapsing groups may also affect selectors that rely on the original element hierarchy. Keep that pass disabled when your application intentionally addresses those wrapper groups.

Inline delivery, React, and local previews

Inline SVG avoids a separate image request and lets a component inherit styles, but its markup becomes part of the HTML or JavaScript delivered to visitors. Reducing unnecessary syntax can lower parse and transfer work, particularly for repeated icons. Browser caching and gzip or Brotli compression still affect the real network cost: a ten-percent raw-file saving is not a promise of ten-percent faster rendering. For large illustrations, a separately cached image can be more appropriate than repeating the entire vector in every page.

The previews use SVG image sources rather than inserting pasted elements into the live page. This workspace accepts static vectors and rejects executable content, embedded raster images, animation, and external resource references. It is an optimizer for supported artwork, not a universal sanitizer. The React export omits non-rendering editor metadata, converts attributes and inline style syntax into JSX, and forwards props to the root element. Review its accessible name, styling, and any repeated IDs before integration. Downloads and clipboard operations happen only when you request them; clipboard permissions may require copying the selectable output manually.

Three steps. A finished file.

  1. Choose or paste a static vector

    Drop one SVG under 2 MB or paste its complete XML markup. Unsupported active content and external references are rejected before preview.

  2. Choose passes and compare

    Set coordinate precision, metadata cleanup, ID cleanup, group collapse, and multipass. Wait for the worker and compare original and optimized vectors.

  3. Export the version you verified

    Check actual byte counts and fine geometry, then download the optimized SVG or copy SVG or React component code.

Useful answers before you export

A little clarity.

Will this optimizer remove my viewBox?

No. The viewBox-removal plugin is not enabled. A source viewBox remains available for responsive rendering; the tool does not invent one when the original omits it.

Can cleaning SVG IDs break application styles?

Yes, external references can depend on the original IDs. ID cleanup starts disabled because the optimizer cannot inspect your application's CSS or JavaScript.

Does a smaller SVG always look identical?

No. Numeric rounding and structural changes can affect fine geometry or integration behavior. Compare the previews and test the exported asset in its intended application.