Popular tools

Developer tools
Developer · Free · Private

SVG Optimiser

Make SVG files smaller and cleaner, and see for yourself that nothing changed.

  • Runs in your browser
  • No upload
  • No sign-up

Drop files here, or

SVG files, one or many · or paste SVG code below

Stays on your device

Paste SVG code instead
It’s optimised as you type.

What to clean

decimals

    Free, thanks to you. If this tool saved you time, a coffee helps keep it free.

    About this tool

    SVG Optimiser makes SVG files smaller and tidier without changing how they look. Files saved from Inkscape, Illustrator, Sketch or Figma carry a lot that browsers never use: editor settings, metadata, comments, empty groups, ids nobody points at, and numbers with six or more decimal places. Stripping that out often halves the file, which means faster pages and cleaner code to paste into a website or app.

    Drop in one SVG or a whole folder’s worth, or paste the code. Each clean-up is its own switch with a short note, and the safe set is on from the start. Path data is rewritten using whichever of absolute or relative commands is shorter, and numbers are rounded to the decimal places you choose; tiny drawings automatically keep extra digits.

    You don’t have to trust it. Every file is drawn twice, before and after, and the two pictures are compared pixel by pixel, so each row says “Looks the same” or warns you. Both pictures are shown as plain images, so a script hidden in an SVG never runs on the page. Nothing is uploaded: the whole job happens in your browser.

    How to use SVG Optimiser

    1. Tap “Choose SVG files” or drop SVGs onto the box. Or open “Paste SVG code instead” to paste code, or press “Try an example” there for an Inkscape-style file.
    2. Check the switches under “What to clean”. The safe ones are already on; “Safe defaults” puts them back.
    3. Pick how many decimals “Round numbers to” keeps. Two suits most icons and illustrations.
    4. Press a file’s row to see it before and after, the pixel check, and the code. Use “Copy code” or Download.
    5. Use “Download all (ZIP)” for a batch, or “Start over” to clear the list.
    Example

    A 2.3 KB badge saved by Inkscape, with a namedview, RDF metadata, an unused gradient and eight-digit numbers, comes out at 570 bytes — 76% smaller — and the pixel check shows 0% of pixels changed.

    Features

    • Removes Inkscape, Sodipodi, Illustrator, Sketch, Figma, Serif and Corel editor data, plus metadata, comments and the XML declaration.
    • Removes ids nothing refers to and gradients, clip paths, masks and filters nothing uses; <symbol> sprites are kept.
    • Collapses groups that do nothing, removes empty groups and attributes, and drops default values such as x="0".
    • Shortens path data: absolute or relative per segment, flat lines as H and V, no repeated letters, no needless spaces or zeros.
    • Rounds numbers to 0–5 decimals without drift along long paths; transforms and gradients keep extra precision.
    • Minifies style attributes and <style> sheets and shortens colours (#ffffff to #fff, rgb() to hex).
    • Optional: remove title and description, swap width and height for a viewBox, or prettify the code.
    • Before/after preview on checks, light or dark, a pixel-by-pixel look check, gzipped sizes, batch ZIP download and .svgz input.

    Tips and good to know

    • Keep titles and descriptions if the SVG is a meaningful image on a web page: screen readers read them out.
    • If a web page’s CSS or JavaScript reaches into the SVG by id, switch off “Remove unused ids” so those ids stay.
    • “Remove width and height” lets an icon scale to whatever box you put it in; leave it off if the file must keep a fixed size.
    • If the check says “Looks different”, raise the decimals first. Zero decimals is only for drawings on a large grid.
    • Servers usually send SVG gzipped, so the gzipped figure is closer to what visitors really download.

    Frequently asked questions

    Are my SVG files uploaded?

    No. The files are read and optimised inside your browser, and the previews are drawn on your device. Nothing is sent anywhere.

    Is it free? Are there limits?

    It is free, with no sign-up and no limit on the number of files. Very large SVGs (many megabytes of path data) can take a moment.

    Does it work on a phone, or offline?

    Yes, it works in modern browsers on iPhone, Android and computers. The page needs a connection to open, but the optimising itself runs on your device.

    Will optimising change how my SVG looks?

    With the default switches it shouldn’t, and you can see for yourself: each file is drawn before and after and compared pixel by pixel. If anything differs, the row says so and you can raise the decimals or switch an option off.

    Is this the same as SVGO?

    It is our own optimiser, written from scratch for this page, doing the same kind of job: editor data, ids, groups, path data, numbers and styles. Unlike a command-line tool, it shows the result and checks the look as you go.

    Why did one file get no smaller?

    It was probably clean already, as many icon-library exports are. A file pasted without its xmlns can even grow a little, because the tool adds the xmlns it needs to open as a file.

    Is it safe to optimise an SVG that contains a script?

    Yes. The previews are shown as images, which never run scripts, and the code is only shown as text. Ids are left alone in files with scripts, since a script may look them up.

    Page last reviewed

    Send feedback

    Takes a minute. A real person reads every one.

    What kind of feedback?
    Sent with this deviceDetails

    Added so we can recreate problems on the same kind of device. No name, no files, no precise location.

    Please don’t include passwords or private details. What we keep