SVG Tools

SVG Minifier

Reduce SVG file size, compare the actual savings, and check that your graphic still looks right.

Your SVG stays in your browser and is never uploaded to a server.

About This Tool

SVG Minifier reduces extra comments, formatting, and editing information in SVG files. It creates a new result and shows the original size, output size, and savings in bytes and percent so you can decide which version to use.

How to Use

  1. Choose an SVG file or paste its source.
  2. Start with the default conservative mode. Try further optimization if you need a smaller file.
  3. Click Minify SVG and compare file sizes and the before-and-after static previews.
  4. Check the shapes and text, then copy the result or download minified.svg.

Features

  • Conservative minification is the default; further optimization is optional.
  • Sizes are measured in UTF-8 bytes. If the result is larger, the increase is shown.
  • The result remains an SVG that you can scale and edit.

What each mode changes

  • Conservative mode removes ordinary comments and unnecessary whitespace between elements. It preserves titles, descriptions, metadata, IDs, definitions, path precision, text whitespace, and license comments.
  • Further optimization may adjust numeric precision, combine paths, or rewrite shapes. Titles, descriptions, metadata, IDs, and viewBox are retained. Check fine details, small icons, and text before downloading.
  • The main download retains unchanged original content, which may include scripts or external references. The preview filters these out, and a separate filtered SVG download is available.

SVG Safety

Previews use a filtered static copy. Scripts, click events, animations, external images, fonts, and styles do not run or load. External references, embedded web pages, and unsupported content are removed, so the preview may differ from the original. Documents with a DOCTYPE or custom entities are not supported.

SVG files and UTF-8 source are limited to 2 MiB, 20,000 nodes including elements and text, and 96 nesting levels. Simplify files that are too large or complex before trying again.

Privacy

Your SVG stays in your browser and is never uploaded to a server.

Inputs and results are not saved automatically. Download anything you want to keep before clearing the tool or leaving the page, and keep a copy of your original.

FAQ

Will minifying an SVG reduce its quality?

Conservative mode mainly removes unnecessary content. Further optimization can change numbers or shape descriptions, which may affect details. Compare the preview and keep your original.

Why can SVG files be compressed?

SVG files can contain indentation, comments, editing information, and redundant descriptions. Removing these often reduces size, but an already optimized file may not get smaller.

Does minification remove metadata?

This tool preserves metadata, titles, and descriptions, which may contain authorship, copyright, or usage information. Ordinary comments may be removed.

How does SVG compression differ from JPG compression?

SVG compression changes the text describing a graphic and keeps a vector file. JPG compression works on pixels and may discard image details.

Back to the Developer Tools Directory