Free SVG Optimizer — Compress and Minify SVG Online
Reduce SVG file size using SVGO. Remove editor metadata, comments and redundant code without changing appearance. Safe, Recommended or Aggressive preset.
Click to upload SVG file
SVG only
Optimization preset
SVGO defaults — best balance of size reduction and safety.
How it works
- 1Upload an SVG file or paste SVG code into the text area.
- 2Choose an optimization preset: Safe, Recommended or Aggressive.
- 3Click "Optimize SVG" to run SVGO entirely in your browser.
- 4Check the before/after preview and stats to confirm quality is preserved.
- 5Download the optimized SVG or copy the code to your clipboard.
Frequently asked questions
What bloats SVG files
When designers export SVGs from tools like Figma, Adobe Illustrator, Inkscape or Sketch, the exported file often contains far more data than the browser needs to render the image. Common bloat includes:
- Editor metadata — Illustrator embeds its own XML namespaces, Inkscape adds
inkscape:andsodipodi:attributes, Figma includes layer names and comments. None of this is visible in the browser. - Inline styles — Editors often write every property as an inline
style="…"attribute. SVGO converts these to presentation attributes that compress better. - Unnecessary IDs — Auto-generated IDs like
g123456take space and can cause conflicts when multiple SVGs appear on the same page. - Hidden elements — Guides, artboard markers and invisible layers are often exported even though they are never displayed.
- Redundant transforms — Nested
translate(0,0)or identity matrices add bytes without changing anything. - Overly precise numbers — Coordinates like
123.456789can usually be rounded to123.46with no visible difference.
Safe vs aggressive optimization — when each applies
Safe mode only removes obvious non-rendering content: XML processing instructions, DOCTYPE declarations, editor comments and whitespace. It does not rename IDs, merge paths or modify any graphical element. Use this when the SVG will be embedded inline in HTML and you are worried about breaking CSS selectors or JavaScript that references specific element IDs.
Recommended (default) applies the full SVGO preset-default plugin set. It merges compatible path segments, removes empty groups, collapses redundant transforms, rounds coordinates and shortens colours. This is the right choice for the vast majority of SVG files — it reduces file size by 20–60% without any visible change.
Aggressive enables additional plugins including removeHiddenElems, convertShapeToPath, mergePaths and reusePaths. These can cut file size by another 5–20% but may restructure the SVG significantly. Use this for static decorative images where you do not need to target individual elements with CSS or JavaScript.
SVG optimization for web performance
Google's Core Web Vitals measure Largest Contentful Paint (LCP), which is directly affected by the size of resources above the fold. Unoptimized SVG logos exported from design tools routinely run 50–200 KB — 5–20× larger than they need to be. After optimization and gzip compression, the same logo might weigh 3–10 KB, shaving 50–100 ms off LCP on slow connections.
SVGs also contribute to Total Blocking Time when rendered inline. Excessive <path> elements mean more paint work for the browser. Aggressive optimization and path merging reduce the number of draw calls, improving rendering performance on mobile devices.
For icons displayed at small sizes (under 24 px), consider combining the optimized SVG with our Favicon Generator to create ICO and PNG fallbacks, and with SVG to Image to pre-render high-DPI PNG sprites for older browsers.
What SVGO removes and what it keeps
SVGO is the most widely used SVG optimizer and powers plugins in Webpack, Vite, Rollup, Gulp and many design tools. It works by applying a series of independent plugins in sequence. Each plugin performs one specific transformation, making the process transparent and configurable.
SVGO always preserves the visual appearance of the SVG (in Recommended mode). It keeps all visible shapes, fills, strokes, gradients, masks, clip-paths and text. It also preserves the viewport and aspect ratio. What it removes is the redundant, invisible or redundant markup that inflates the file without affecting what the user sees.
One thing to be aware of: SVGO may rename or remove IDs. If your SVG references specific element IDs in an external CSS file or JavaScript animation library, use Safe mode or configure cleanupIds: false to prevent renames.
Tips for best results
- Export from Figma or Illustrator with "Outline Text" enabled to avoid font dependencies, then optimize here.
- Run the optimizer after every export as part of your design workflow, not just before deployment.
- After optimization, check that gradients and masks still render correctly in the preview below.
- For animated SVGs (SMIL or CSS animations), use Safe mode to avoid removing elements that are invisible at rest but visible mid-animation.
- Combine SVG optimization with our Image Compressor workflow to ensure all assets on your page are as small as possible.
Keep going
Related Tools
Image to SVG Converter
Convert PNG and JPG images to scalable SVG vectors automatically
SVG to PNG/JPG Converter
Convert SVG vector files to PNG, JPG or WebP at any resolution
Image Compressor
Compress JPG, PNG, and WebP images without losing quality.
Favicon Generator
Generate a complete favicon package from any image — all sizes plus HTML snippet
Image Resizer
Resize images to exact dimensions or social media presets.
Image Format Converter
Convert images between JPG, PNG, WebP, AVIF, and HEIC formats.
Color Palette Extractor
Extract a beautiful color palette from any image automatically
Image to PDF
Convert JPG, PNG, WebP images into a single PDF document