Developer tool
SVG Optimizer and Converter
Minify SVG code in your browser, see the size saved and a visual check, then convert it to PNG, JPG or WebP at any scale or copy it as a data URI.
Free, no sign-up. Runs in your browser; nothing is uploaded.
Your SVG
Original: 862 B
Optimised SVG
463 B (46.3% smaller)
Optimiser options
Fewer decimals means smaller files. Tiny viewBoxes get extra decimals automatically.
Keep unused IDs if your page CSS or JavaScript targets them. Title and desc help screen readers, so they stay by default.
Preview
Convert to PNG, JPG or WebP
Natural size 120 x 120. Output 240 x 240.
Embed as a data URI
The URL-encoded form is usually smaller than Base64 for SVG. Use either inside CSS or an img src.
How to use the svg optimizer and converter
Why optimise SVG
SVG files saved from Illustrator, Figma, Inkscape or Sketch are full of things a browser does not need: editor settings, comments, empty groups and numbers with ten decimals. Removing them makes pages load faster and keeps your code tidy, without changing the picture.
How to optimise
- Paste the SVG code into the left box, or press Open file. A sample is loaded so you can see the effect at once.
- The right box shows the optimised code, the new size and the percentage saved.
- Compare the Original and Optimised previews. A small visual check also draws both and tells you if they match.
- Adjust the options if needed, then Copy or Download .svg.
What each option does
- Number precision rounds coordinates. Three decimals is usually invisible. Icons drawn on a very small grid automatically get extra decimals.
- Remove comments, metadata and editor data strips Inkscape, Sketch and similar leftovers.
- Remove unused IDs deletes IDs that nothing refers to.
- Shorten colours turns #ffffff into #fff and rgb values into hex.
- Collapse whitespace removes spaces between tags, but never inside text, style or script elements.
- Remove width and height keeps only the viewBox so the SVG scales to its container.
Convert to PNG, JPG or WebP
Choose a scale from 1x to 8x, or type an exact width in pixels. Pick the format and whether the background is transparent or a colour, then download. Because SVG is vector, big sizes stay perfectly sharp.
Embed in CSS
Copy the SVG as a Base64 or URL-encoded data URI to use as a CSS background or an image source with no extra file request. URL-encoded is usually shorter.
When not to optimise
If your SVG relies on external fonts, scripts or animations controlled from outside, test it after optimising. Keep your original file as the editable master.
Frequently asked questions
How much smaller will my SVG get?
Files exported from design tools often shrink by 30 to 70 percent because they carry editor data, comments, long decimals and verbose attributes. Hand-written or already minified SVGs shrink less.
Will optimising change how my SVG looks?
The defaults only make changes that should not alter rendering. After each run the tool draws both versions and tells you if any pixels differ. If they do, raise the precision or switch an option off.
Why keep title and desc?
They give screen readers a name and description for the graphic. They are kept unless you choose to remove them.
What does remove unused IDs do?
It deletes id attributes that nothing refers to. IDs used by gradients, clip paths, masks, links and style rules are always kept. Turn it off if your own page CSS or scripts target IDs inside the SVG.
Is my SVG uploaded?
No. Optimising and converting both run in your browser.