SVG Optimizer
Shrink SVG files with SVGO: remove metadata and bloat, control precision, keep IDs and viewBox, and compare before and after.
Processed locally in your browser. Your file is not uploaded.
What this tool does
SVG files exported from design tools often carry editor metadata, comments, default values and over-precise numbers. This tool runs SVGO (the standard SVG optimiser) in your browser and shows the size before and after, along with a visual preview of both versions so you can confirm nothing changed.
Options cover the choices that actually matter: keep the viewBox so the image still scales, keep id and class names when your CSS or JavaScript refers to them, remove metadata, comments or titles, choose how many decimals paths keep, and strip scripts. When a file is already minimal the tool says so rather than pretending to save bytes.
The preview is rendered through an image element, so scripts inside an SVG never run on this page, and the code is shown as text. If the SVG contains scripts, event handlers, foreignObject or external references you will see a warning. Nothing is uploaded.
How to use it
- 1Add an SVG file.
- 2Review the warnings, if any, about scripts or external references.
- 3Adjust the options. The result updates automatically.
- 4Compare size and preview before and after.
- 5Copy the optimised code or download the .min.svg file.
Supported formats
Input and output: SVG (.svg).
Privacy
This tool runs in your browser. The data you provide is processed on your device and is not sent to our servers.
Limitations
- Lower precision shrinks files but can visibly distort fine detail; compare the preview before using the result.
- Removing IDs or classes can break CSS, JavaScript or <use> references; enable Keep IDs if you depend on them.
- Removing the viewBox makes the image stop scaling with its container; it is kept by default.
- Files that are already optimised may not shrink at all, and in rare cases can grow slightly.
- Only SVG images are supported; embedded raster images inside the SVG are not recompressed.
FAQ
Is optimisation lossless?
With the default settings the image should look identical. Reducing precision, merging paths or removing titles changes the file contents, so always compare the preview.
Why did my SVG not get smaller?
It may already be minified. Try fewer decimals, or remove titles and metadata if you do not need them.
Is it safe to open SVG files with scripts?
The preview uses an image element, which does not run scripts, and the code is displayed as text. Still, do not host SVGs from untrusted sources inline on your own pages. Enable Remove scripts to strip them.
What does Keep IDs do?
SVGO normally shortens or removes IDs it considers unused. Keeping them preserves hooks for CSS, animations and <use> references.
Related tools
Favicon Generator
Turn one image into a full favicon package: favicon.ico, PNG sizes, Apple touch icon, Android icons, web manifest and HTML tags.
Color Palette Generator
Generate colour harmonies from a base colour, lock favourites, check WCAG contrast and export to CSS, Tailwind, JSON or PNG.
Open Graph Image Generator
Design a 1200x630 social share image with your title, logo and background, and download it as a PNG. Runs entirely in your browser.
Image to Color Palette
Extract the dominant colours from any image, copy hex codes, pick exact pixels with an eyedropper and export the palette.