SVG Compressor: Make SVG Files as Small as Possible

Strip hidden data and round numbers to shrink an SVG, with the real gzip size shown.

SVG Compressor tool

1Add your SVG

Drop your SVG here, or click to browse Or paste SVG code anywhere on the page. Nothing is uploaded.
No file?

2Adjust the options

3Preview and download

Live preview
sample.svg
Input and output codeView, edit and copy the code
Input SVG code
Output

Under the hood

How SVG Compressor works

An SVG compressor makes an SVG file smaller by removing hidden data and rounding numbers. This one starts at an aggressive 1-decimal precision, so it is aimed at the smallest possible file.

  1. <svg xmlns:inkscape="…"><metadata>…</metadata><path d="M200.000000 …"/>

    Measure the original

    The converter reads the SVG and records its size, so every saving can be measured against it.

    String length · bytes
  2. Strip hidden data

    The XML declaration, DOCTYPE, metadata block, editor attributes, comments and the title and description are removed.

    Regex passes
  3. d="M200.000000 150.000000"d="M200 150"

    Round the numbers

    Path and shape coordinates are rounded to 1 decimal place by default. For most artwork the change is invisible, and it shortens every number.

    Precision 1 · round
  4. SVGsmaller

    Report real savings

    The result is shown with a bytes-saved chart per step and the true gzip size, which is what browsers receive over the network.

    CompressionStream · gzip
The four stages of the SVG Compressor, from your input to the finished file.

What makes compression aggressive

Number precision
Dropping to 1 decimal saves the most bytes, but very fine geometry can shift slightly.
Title and description removed
These are removed here for size. Keep them if screen readers need them.
Gzip estimate
The gzip figure shows what visitors actually download.

Step by step

SVG Compressor process

Four steps compress an SVG. Compare the before and after previews to make sure it still looks identical.

  1. Add your SVG

    Drop a file, paste code or press the sample button. Editor exports such as Inkscape and Illustrator shrink the most.

    Tip: The sample is full of editor data.

    Drop SVG
  2. Check the precision

    Keep Number precision at 1 for maximum compression, or raise it for detailed art.

    Tip: Watch the preview for shifts.

    PrecisionWhitespaceMetadata
  3. Choose what to remove

    Keep the toggles for comments, metadata and colors on. Turn title and desc off if you need accessibility text.

    Tip: Each toggle changes the chart.

  4. Download the compressed SVG

    Press Download to save the smaller file.

    Tip: Everything runs locally.

    Download SVGsvg-compressor.svg

Use the SVG Compressor

Reference

SVG Compressor settings / conversion chart

The table lists the compression levels and what each removes. The chart shows how much each step typically contributes to an editor-exported SVG.

Typical contribution to the savings (editor-exported SVG)

Typical contribution to the savings (editor-exported SVG)Number precision: 5/5; Editor data and metadata: 4/5; Whitespace: 3/5; Comments: 2/5; Color shortening: 1/5.Number precision5/5Editor data and metadata4/5Whitespace3/5Comments2/5Color shortening1/5
Guide: precision rounding and editor data tend to save the most; the exact split is shown for your file.

At a glance

  • Converts best: Number precision.
  • Needs the most care: Color shortening.

Guide: precision rounding and editor data tend to save the most; the exact split is shown for your file.

SVG Compressor settings by goal
GoalNumber precisionTitle and descRisk
Smallest possible file0–1 decimalsRemovedFine detail may shift
Web icons1–2 decimalsRemovedVery low
Illustrations2–3 decimalsKeptLow
Technical drawings4+ decimals or offKeptNone

Answers

SVG Compressor FAQ

Questions people ask about the SVG Compressor, answered for this specific use case.

How much smaller can an SVG get?

Editor-exported files commonly shrink by half or more. The exact saving for your file is shown in the Result tile and the savings chart.

Will compression change how my SVG looks?

At 1-decimal precision, simple artwork looks identical. Check the before and after previews, and raise precision if fine detail shifts.

What is the gzipped size?

It is the size after gzip compression, which is what most web servers send. It is usually much smaller than the raw size.

Should I remove the title and description?

Only if you do not need accessibility text. Screen readers use them to describe the image.

What is the difference between the SVG Compressor and the SVG Optimizer?

This compressor starts at a more aggressive precision and removes the title and description. The SVG Optimizer is gentler by default.

Ready to try it?

Your result is one drop away.

Open the SVG Compressor

All converters

Every free converter and SVG tool

43 free tools that run in your browser. Pick a converter below, or search by format or task.