Skip to content
Find a tool

SVG Optimizer

Remove editor leftovers and round coordinates to make an SVG smaller without changing how it looks.

Free · runs in your browser · nothing is uploaded

Open on Outlinecut

This embed was switched off for this website. Open on Outlinecut

Add this tool to your siteFree embed code, no sign-up. Keep the credit link.

Embed this tool

Copy this code into your website, blog or class page. The tool runs inside your page.

Optional settings, added to the address after embed=1: &accent=0f6b5c (colour, 3 or 6 hex digits). Other parameters are ignored.

Please keep the credit link below the tool.

An SVG optimizer makes an SVG file smaller by removing data a viewer never draws, such as editor metadata, comments and extra decimals, and the page shows how many bytes that saved. This one runs SVGO 4.1.0 in your browser and gives you three presets: Safe, Aggressive and Cut file. After each run the line under the preview shows the file size before and after and the percentage saved, and Download SVG saves the result. Safe changes nothing visible and is the default. Cut file is meant for cutters and plotters, and Aggressive trades some safety for the smallest file. The viewBox is always kept, so the picture scales exactly as before.
Svg optimizer example

How to use the SVG Optimizer

  1. Press Choose SVG file, or drop an SVG on the page. You can also open Or paste SVG code and paste the markup. Try a sample loads a small example. The engine loads the first time you use the tool, so the first run can take a moment.
  2. Open Optimization level and pick Safe (keeps everything visible), Aggressive (smallest file) or Cut file (keeps paths, drops extras). Safe is the default.
  3. Read the line under the preview: Before and After give the file size in KB, and Saved % gives the percentage. Paths and Nodes describe the drawing.
  4. Look at the preview to confirm the picture still looks right.
  5. Try the other levels and compare the numbers.
  6. Press Download SVG.
  7. Open the downloaded file in a browser, and in your cutting or design software, before you rely on it.

If the text is not an SVG, the page says “This does not look like an SVG file.” If the SVG has no drawable shapes, it says so instead of returning a file. Text, images, masks and filters do not count as drawable shapes for this check.

Keep your original file. Aggressive removes titles and descriptions and rounds to 2 decimals, and Cut file rewrites shapes as paths, so you may want the untouched version later.

What is SVG optimization?

SVG optimization rewrites an SVG so it holds the same picture in fewer bytes. Design programs save extras: editor metadata, comments, empty or hidden elements, default values and long numbers. The optimizer drops or shortens them. This tool uses SVGO 4.1.0, an open-source optimizer, and it never removes the viewBox.

What do Safe, Aggressive and Cut file change?

Each preset starts from SVGO’s default set and then changes a few settings. The table lists what the code does.

SafeAggressiveCut file
Decimals kept in numbers323
PassesOneSeveralSeveral
IdsLeft aloneShortened, but ids that <use> or url() point to are keptLeft alone
Title and descTitle keptBoth removedBoth removed
Paths outside the canvasKeptRemovedKept
Shapes turned into pathsNoYesYes
Stroke and fill attributesDefault clean-upDefault clean-upLeft as they are
Output larger than inputInput returned insteadInput returned insteadNot guarded

Cut file also applies transforms to the paths, so a cutter reads the final coordinates directly.

How much file size reduction can I expect?

It depends on the file. One exported with a lot of editor data shrinks noticeably, and an already clean file barely changes. The page shows the real saving for yours, so use that number.

On the small synthetic test SVG with the defaults, the size went from 196 to 189 bytes: 7 bytes, shown as 4%. That file had almost nothing to strip.

How do I clean up an SVG file?

Run it on Safe first and note the saving. If you need more, try Aggressive and check the picture. Use Cut file when the SVG goes to a cutter or plotter and you want plain paths.

  1. Load the file and leave Optimization level on Safe.
  2. Note Before, After and Saved %.
  3. Switch to Aggressive for a smaller file, and open the result to check it.
  4. Use Cut file for paths without titles, descriptions or shapes.
  5. Press Download SVG.

Answers to common questions

Will optimization affect visual quality?

Safe leaves everything visible and rounds numbers to 3 decimals. Aggressive rounds to 2 decimals and removes titles and descriptions, so compare the result with the original.

How much reduction can I expect?

It varies with the file. The page reports the saving in KB and percent after each run.

Is my SVG kept private, and is there a size limit?

The work runs in your browser and nothing is uploaded. This page sets no maximum size of its own.

Is there a free SVG cleaner?

Yes, this page cleans an SVG in the browser and gives you the file to download.

Does it keep the viewBox?

Yes. The viewBox is never removed, so scaling and proportions stay the same.

Can optimization make my file bigger?

With Safe and Aggressive, no: if the result is larger, the original is returned. Cut file is not guarded, because it rewrites shapes as paths.

What happens if the SVG cannot be parsed?

The tool hands your original file back unchanged.

Does it change what the SVG looks like?

Not on Safe, apart from rounding of numbers to 3 decimals. Check Aggressive and Cut file output in your own software.