SVG Optimizer
Minify and clean SVG files with SVGO directly in your browser. Compare sizes, preview the result and download the optimized SVG.
Optimization options
Visual comparison
What is the SVG Optimizer?
The SVG Optimizer runs SVGO 4 — the same open-source optimizer used by most build tools — directly in your browser, inside a background Web Worker so even large files never freeze the page. Paste markup or drop one or many .svg files: each is cleaned of editor metadata, comments, hidden elements and redundant attributes, numbers are rounded to the precision you choose, paths are rewritten in their shortest form, and the result is shown next to the original with exact byte savings.
Fine-tune the output with options for multipass, decimal precision, keeping the viewBox, making the SVG responsive by removing width and height, shortening colors, minifying or prefixing IDs, removing <title> or xmlns and pretty-printing. Copy the result as plain SVG, React-ready JSX, a compact URL-encoded data URI, base64 or a CSS background-image rule, download single files or the whole batch as a ZIP. Previews are rendered as images, so scripts inside an SVG never run, and no file is ever uploaded.
Frequently asked questions
- Why should I optimize SVG files?
- SVGs exported from Figma, Illustrator, Inkscape or Sketch carry editor metadata, unused definitions and over-precise numbers. Removing them commonly cuts file size by 30–70% without any visible change, which means faster pages and lighter inline icons.
- Will optimization change how my SVG looks?
- With the default precision (3 decimals) the result is visually identical for almost every file. Lower precision gives smaller files but can distort very small or detailed icons — check the side-by-side preview before using it.
- Should I keep the viewBox?
- Yes. The viewBox is what lets an SVG scale. Keep it on, and enable “Responsive” if you want the SVG to fill its container via CSS instead of having fixed width and height.
- What is the JSX output for?
- React requires camelCase attributes (strokeWidth, fillRule), className instead of class and style objects. The JSX tab converts the optimized markup so you can paste it straight into a component.
- Data URI or base64 — which is better?
- For SVG, a URL-encoded data URI is usually smaller than base64 and compresses better with gzip or Brotli. Use base64 only when a tool specifically requires it.
- Is it safe to optimize untrusted SVGs here?
- Yes. Files are processed locally and previews are displayed through an <img> element, where browsers block scripts and external resources. Note that optimization is not sanitization: it does not guarantee that a malicious SVG becomes safe to inline on your site.
- Are my files uploaded?
- No. SVGO runs entirely in your browser; your SVG code never leaves your device.
Related tools
- Image to WebPConvert PNG and JPEG images to lightweight WebP with adjustable quality, batch processing and ZIP download — no uploads.
- Image ResizerResize and compress JPG, PNG and WebP images by pixels or percentage, keep the aspect ratio and download in bulk. Nothing is uploaded.
- Favicon GeneratorGenerate a complete favicon set (multi-size ICO, PNGs, Apple touch icon and web manifest) from an image, a letter or an emoji — entirely in your browser.
- Color ConverterConvert colors between HEX, RGB, HSL, HSV, CMYK and OKLCH, pick colors visually and generate shades, tints and color harmonies.
- Contrast CheckerCheck the contrast ratio between text and background colors against WCAG 2.2 AA and AAA, with live preview and suggested fixes.
- CSS Gradient GeneratorDesign linear, radial and conic CSS gradients with multiple color stops and copy production-ready CSS or Tailwind code.