1. Home
  2. Design tools
  3. SVG Optimizer

SVG Optimizer

Paste or open an SVG and get a smaller file that looks the same, with the saving shown in bytes and percent.

Free, no sign-up. Runs in your browser: nothing is uploaded.

How to use SVG Optimizer

  1. Paste or open the SVG.
  2. Set decimal places and options.
  3. Compare the previews and copy or download the result.

Features

  • Powered by SVGO
  • Decimal precision from 0 to 5
  • Option to keep ids, remove title or dimensions
  • Multiple passes
  • Size before and after with the percentage saved
  • Side-by-side previews

Supported formats

Input

  • SVG code
  • SVG files

You get

  • Optimised SVG

Private by design

Everything you enter is processed by your browser on this device. Nothing is sent to openWorkstand or anyone else, so the SVG Optimizer is safe for private and work data. After you have used it once while online, it also works without an internet connection. How local processing works

Good to know

  • Aggressive precision can move points slightly; compare the previews.
  • Scripts and event attributes are not removed by default.

Guide

Shrinking SVG files with SVGO without changing how they look

SVG files exported from design tools carry a lot of baggage: editor metadata, comments, namespaces for programs you never used, absolute coordinates with six decimals and attributes that merely repeat their default values. None of it changes the picture, and all of it has to be downloaded. SVGO, the optimiser most front-end build pipelines use, removes it. This page runs the same library in your browser so you can clean a single file or a snippet without installing anything.

What gets removed or rewritten

The default preset deletes the XML declaration, the DOCTYPE, comments and editor-specific metadata such as the Inkscape and Sodipodi elements. It drops attributes that equal their default value, shortens colours (#FF3366 becomes #f36), trims numbers (64.000000px becomes 64), collapses empty groups and applies transforms where it can. Path data is rewritten with relative commands, shorter forms such as S for a smooth curve, and no unnecessary spaces. Multiple passes repeat the process until nothing more changes.

A worked example

Press Sample to load an Illustrator export of a round badge with a heart: it has the XML declaration, a generator comment, a DOCTYPE, a metadata block, a title, a group with a no-op transform and six-decimal numbers. The input is 1,259 bytes. With the defaults of three decimals and multiple passes, the output is 317 bytes, a saving of 74.8%. It reads <svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="64" height="64" viewBox="0 0 64 64">, then the title, a circle with fill="#f36" and stroke="#c03", and one path whose d is M32 46S18 36 18 27c0-5 4-8 8-8 …. The original and the optimised previews look the same. Switch on Remove title and the result drops to 291 bytes, 76.9% smaller.

Decimal places

Each coordinate is rounded to the number of decimals you pick. Three is safe for icons drawn on a grid of 24 or 64 units. Going to zero decimals shrinks the sample to 301 bytes but changes some curves into different command types, and on a small icon a one-unit error is visible. Large artwork with a viewBox of thousands of units tolerates fewer decimals than a small icon with the same shapes, because rounding error is relative to the size. Raise the precision to four or five if edges look slightly off.

Protecting what the page needs

Keep ids switches off the cleanup that shortens or removes id attributes. Turn it on whenever CSS, JavaScript, <use> references, gradients defined elsewhere or links like #badge depend on them. Remove title deletes the title element, which is what assistive technology reads for an inline SVG, so use it only for decorative graphics. Remove width and height deletes the size attributes so the SVG scales to its container; it needs a viewBox, which the file here has.

Edge cases

SVGO assumes static graphics. Embedded scripts, SMIL animations and CSS animations can be altered or flattened, so test them. Text that relies on a font stays as text; convert it to outlines in your editor if the font will be missing. Files with several nested transforms may change structure but not rendering. If the input is not valid SVG the page shows the parser’s message and no output.

Limits

Optimising reduces size, but it does not make a complex drawing simple: a trace with thousands of points will remain large. Raster images embedded as base64 are left untouched; compress them separately. Gzip or Brotli on the server will compress the result further. The tool processes one file at a time.

Checked against the current version of the SVG Optimizer on .

Frequently asked questions

Is it safe to remove the title from an SVG?

Only if the graphic is decorative or its meaning is given somewhere else, such as an aria-label on the button that contains it. The title element is what screen readers use as the accessible name of an inline image.

Why did my icon break after optimising?

Common causes are removed or renamed ids that CSS or scripts refer to, too few decimals on a large drawing, or removed dimensions on a file without a viewBox. Switch on Keep ids, raise the precision, and compare the two previews.

Will optimising change how my SVG looks?

It should not, but rounding numbers moves points slightly. Keep 3 decimals for icons and use 4 or more for large artwork, and always compare the two previews.

Why keep ids?

Other CSS or scripts may refer to elements by id, and ids in gradients and masks are referenced inside the file. SVGO shortens or removes ids by default, so switch the option on if you rely on them.

Keep working with the result

openWorkstand also includes a free workspace with documents, spreadsheets, tasks, projects and a calendar that save to a folder on your computer.