SVG optimiser
Make SVG files smaller by removing editor leftovers and extra detail. The picture looks the same.
Files
SVG markup
Settings
The defaults are safe. Lower precision gives smaller files and may move shapes slightly.
How it works
- Add an SVG file, or paste the markup into the box.
- Leave the safe defaults on, or adjust the number precision and the options below them.
- Compare the sizes and the two pictures, then download the file or copy the markup.
FAQ
- Does the picture change?
- It should look the same. The tool removes comments, editor data, hidden and empty elements and unneeded digits. Lowering the number precision can move shapes by a tiny amount, so check the preview.
- What is number precision?
- How many digits are kept after the decimal point in coordinates. 3 is a safe default. Small icons can use 1 or 2, and large drawings may need more.
- Why keep the viewBox?
- The viewBox lets an SVG scale to any size. Without it, the picture may stop scaling. Removing width and height also needs the viewBox, so that option keeps it.
- Why keep IDs?
- Style sheets and scripts on your page may refer to an element by its ID. Keeping IDs is safer. Turn it off to shorten or remove them when nothing refers to them.
- Is it safe to preview an SVG from somewhere else?
- Yes. The previews show the SVG as a picture, and scripts inside it do not run. The tool never puts SVG markup into the page itself.