SVGO Presets Explained: Optimize SVG Without Breaking the Render

SVGO Presets Explained: Optimize SVG Without Breaking the Render

Safe, default or aggressive? Pick the right SVGO preset and optimize SVG for production.

19.07.2026
10 min read
Share this article:
SVG
svgo
Optimization
presets
Web
Tutorial

Why SVGO presets matter

A Figma or Illustrator export is often verbose: editor metadata, excessive decimal precision, redundant IDs. The online SVG minifier strips whitespace and comments in one click — great for a quick cleanup. The SVG optimizer (SVGO) goes further with three presets — safe, default, and aggressive — that enable or disable SVGO plugins based on visual risk. Everything runs in the browser on the online SVG tools hub. For the big picture, see the complete SVG optimization guide.

Three presets mapped to real risk levels (safe → aggressive)
Size reduction beyond whitespace-only minify
viewBox, title and desc preserved on all FastMinify presets
Before/after size stats in the tool
No upload — 100 % browser-local processing

Real-world size impact

Example: icon exported from a vector editor

On a 24×24 icon with metadata and over-precise paths, the three presets produce different gains. Exact numbers vary by file — the tool shows before/after bytes and percent saved.

Before optimization

File size:~4.2 KB
Load time:

After optimization

File size:safe ~3.4 KB · default ~2.1 KB · aggressive ~1.6 KB
Load time:
When the preset barely changes anything

An SVG already minified manually or run through SVGO several times may converge: safe ≈ default ≈ aggressive. In that case whitespace minify is enough — no need to rerun aggressive.

Best practices and pitfalls

When not to over-optimize

SVGO aggressive can break downstream workflows: SMIL/CSS animations keyed on IDs, embedded scripts, complex filters, or `<use href="#id">`. In those cases stay on safe or optimize manually.

SVG with animation or `<script>` → safe only
Sprites with `<symbol id="…">` references → avoid aggressive
Detailed hero illustrations → default + visual review
Don't chain optimize + re-export from the editor without retest
Keep the design source file (Figma/AI) as truth
Build and CI integration

In production, lock the preset in your pipeline (svgo npm, Vite/Webpack plugin) and align it with what you validate in the browser. See also the minification in CI/CD article for broader automation.

Same preset locally, in CI, and in the online tool → consistent results
Commit optimized SVG, not only the heavy source
Per-asset size budget in PR review
Visual snapshot tests for critical icons
SVG hub to prototype the preset before writing config

Preset comparison table

Pick the right preset

The right preset depends on asset type and your tolerance for visual risk — not the percentage alone.

Preset

format:safe — single pass, structural plugins off
validate:default — multipass, standard preset-default
minify:aggressive — floatPrecision 1 + mergePaths

When to use it

format:Logos, animated SVG, IDs referenced in CSS/JS
validate:UI icons, marketing pictos, daily workflow
minify:Sprites, simple icons, mobile-critical size
Recommended order

Ramp up pressure gradually rather than starting aggressive.

Try safe on a representative sample
Move to default if the render is identical
Try aggressive only on non-critical assets
Compare visually at 100 % and 200 % zoom
Version the source SVG — never overwrite the original

When the browser tool is enough

Common scenarios

No need to install SVGO to compare three presets on a file received by email.

Compare safe vs default vs aggressive on a client export
Decide the preset before adding it to the repo
Unblock a perf ticket "SVG too heavy" without Node
Train a designer on export impact
One-shot before pasting into a CMS or email template

Limits: SVGO CLI and CI

What the browser does not replace

The online tool is ideal to explore and validate a preset. Batch on hundreds of SVG, pre-commit integration, and custom plugin config remain the domain of SVGO npm or bundler plugins.

Optimize an entire `icons/` folder in one command
Custom SVGO config (plugins outside FastMinify presets)
CI gate: fail if size exceeds a threshold
Watch mode during front-end development
Third-party plugins not exposed in FastMinify UI
Align browser and pipeline

Once you pick a preset in the tool, reproduce the same logic (safe/default/aggressive) in your `svgo.config.js` to avoid drift between preview and build.

Document the chosen preset in the design system README
Test aggressive only on a subset of icons
Don't mix optimized and non-optimized SVG in one sprite
Revalidate accessibility after aggressive optimize
Link the SVG hub in internal front-end docs

SVGO CLI and ecosystem

Complementary tools

FastMinify exposes three opinionated presets. Upstream SVGO offers plugin-level granularity — useful when you have very specific team rules.

svgo (npm CLI)

Reference SVGO command line — same engine as the FastMinify browser optimizer.

Pros:
Batch entire directories
Custom JSON/YAML config per project
Native pre-commit and CI integration
Cons:
Node install required
Learning curve for plugins

vite-plugin-svgo / bundler plugins

Optimize on import — handy for React/Vue components.

Pros:
Automatic on every build
Consistent with bundler tree-shaking
No manual step for developers
Cons:
Less visible than an online tool for preset comparison
Harder visual debug in CI alone

FastMinify minify-svg

Fast whitespace cleanup without deep SVGO restructuring.

Pros:
Instant, zero options to pick
Perfect after manual markup edits
Natural complement before or after optimize
Cons:
No path merge or floatPrecision
Limited gain on heavy Illustrator exports

Minify SVG vs SVGO optimize

Two different intents

Quick minify targets syntactic noise (whitespace, comments, obvious redundant attributes). SVGO optimization restructures markup: path simplification, shape merging, ID cleanup — with possible visual impact if you push too far.

Minify: whitespace, comments, light redundant attributes
Optimize (SVGO): preset-default plugins + per-preset overrides
Safe: single pass, aggressive structural plugins off
Default: multipass, balance size vs visual safety
Aggressive: floatPrecision 1, mergePaths and convertPathData enabled
Safe preset — zero visual surprises

The <strong>safe</strong> preset runs SVGO in a single pass (<code>multipass: false</code>) and disables structural transforms: no path merging, no shape→path conversion, no ID cleanup, no hidden element removal. Best for client logos, layered illustrations, or animated SVG.

removeViewBox, removeTitle, removeDesc: kept
convertPathData, mergePaths, convertShapeToPath: off
cleanupIds and removeHiddenElems: off
Modest but predictable gain — often 10–25 %
First try on an unknown or critical SVG
Default preset — production balance

The <strong>default</strong> preset enables <code>multipass: true</code> and lets SVGO apply preset-default with viewBox/title/desc guardrails. This is the daily driver for UI icons, pictograms, and marketing assets after a visual check.

Multipass: multiple SVGO passes to maximize compression
viewBox, title and desc always preserved
Standard preset-default plugins (metadata, precision…)
Typical gain 25–50 % depending on export verbosity
Good default before trying aggressive
Aggressive preset — smallest size

The <strong>aggressive</strong> preset adds <code>floatPrecision: 1</code>, forces <code>mergePaths</code>, and strengthens <code>convertPathData</code>. Size often drops further, but fine details (curves, corners) may shift slightly. Reserve it for simple icons, sprites, or SVG without animation or CSS/JS ID dependencies.

floatPrecision 1: aggressive coordinate rounding
mergePaths force: merge compatible paths
viewBox/title/desc still kept on FastMinify
Possible 40–70 % gain on heavy Illustrator exports
Always compare visually before shipping to prod

Using the FastMinify SVGO optimizer

Three-step workflow

Paste your SVG, pick the preset in the options panel, then compare output and stats. The online optimize SVG tool runs entirely in the browser — nothing is sent to a server.

Paste or load an SVG file (size limit shown in the tool)
Select safe, default or aggressive
Read before/after bytes and % saved
Copy the result or fall back to quick minify if needed
Chain with validate-svg for accessibility on informative icons
Quick minify as a complement

For whitespace-only cleanup without touching paths, the SVG minifier is faster. Chain minify then optimize default if you want both passes.

Minify: syntactic noise only
Optimize: SVGO restructuring by preset
Beautify SVG to read markup after optimize
SVG viewer for preview before export
SVG hub for the full cluster (JSX, Data URI, resize…)
After optimization

Informative icons should keep title and desc — FastMinify preserves them on all three presets. To validate a11y structure, use validate SVG online before delivery.

validate-svg: title/desc and basic structure
svg-to-jsx if the SVG becomes a React component
minify-html if you inline SVG in a page
SVG accessibility article (coming on the hub)
Back to the general SVG guide for performance context

Conclusion

SVGO presets encode a size vs visual risk tradeoff. Start with safe on sensitive assets, adopt default for daily flow, and reserve aggressive for simple icons where every byte counts. FastMinify lets you compare all three modes locally before locking config in CI.

Try safe before default or aggressive on an unknown SVG
Preserve viewBox, title and desc — already guaranteed on FastMinify
Compare visually at multiple zoom levels
Align the browser preset with svgo.config.js in CI
Read the general SVG guide for minify vs optimize context
Share this article
Share this article: