svgo
4.1.0 · 24 Aug 2026MIT52.3M / weekRepositoryHomepagenpmAtom feed
3.3.5 is the newest release of 3.x.
In short
1 faster13 fixed5 changed3 internal
Security
4 advisories affect 3.0.3; 3.3.5 fixes them
- HighSVGO: removeScripts allows executable links through namespace and control-character bypassesGHSA-w27v-7q3p-w38r · 8 Sep 2026Fixed in 3.3.5
- HighSVGO removeScripts plugin leaves some executable scripts intactGHSA-2p49-hgcm-8545 · 21 Jul 2026Fixed in 3.3.4
- HighSVGO DoS through entity expansion in DOCTYPE (Billion Laughs)GHSA-xpqw-6gx7-v673 · 4 Mar 2026Fixed in 3.3.3
- ModerateSVGO: removeScripts incompletely sanitizes executable HTML in SVG foreignObject elementsGHSA-4vpr-x523-8j87 · 8 Sep 2026Fixed in 3.3.5
Release note
Includes various bug fixes and optimizations for existing plugins.
We're also revamped the documentation for the project. You can find it on svgo.dev!
The frontend for svgo.dev is maintained in svg/svgo.dev, contributions are welcome.
What's Changed
Default Behavior
removeComments, introduces
preservePatternsparameter. Preserves legal comments by default, same as the previous behavior, but can now be overridden.removeDesc, set the
removeAnyparameter tofalseby default for accessibility.
Bug Fixes
removeRasterImages, removes inline JPEG images.
cleanupIds, correctly handle when 2 IDs have been referenced in a single attribute.
cleanupIds, correctly handle when we've encountered a reference to a node that doesn't exist.
inlineStyles, treat style prop keys as case-insensitive.
inlineStyles, remove all classes in multiclass selector.
inlineStyles, ignore empty CSS blocks instead of adding empty style attribute.
minifyStyles, removes unused class selectors when the document has no classes.
prefixIds, reuse the same prefix when encountering an ID multiple times.
removeHiddenElems, stops removing non-rendering elements like masks.
reusePaths, creates a new ID if the current one is referenced by another element.
reusePaths, removes redundant
defschildren after optimization.reusePaths, stops duplicating attributes into the shared definition.
Don't crash on a
null,undefined, or empty plugin. Instead, log a warning and ignore it.
SVG Optimization
convertTransform, omit spaces between functions.
removeScriptElement, removes callbacks (
on*) andhrefattributes withjavascript:URIs.convertOneStopGradients, new plugin to convert gradients with one stop to a solid color, disabled by default.
Performance
Various optimizations for path handling.
Metrics
Before and after using vectors from various sources, with the default preset of each respective version:
| SVG | Original | v3.0.2 | v3.0.3 | Delta |
|---|---|---|---|---|
| Arch Linux Logo | 8.584 KiB | 4.748 KiB | 4.747 KiB | ⬇️ 0.001 KiB |
| Blobs | 50.45 KiB | 42.949 KiB | 42.949 KiB | |
| Isometric Madness | 869.034 KiB | 550.829 KiB | 550.699 KiB | ⬇️ 0.13 KiB |
| tldr-pages Banner | 2.071 KiB | 1.07 KiB | 1.07 KiB | |
| Wikipedia Logo | 161.552 KiB | 118.441 KiB | 118.441 KiB |
Before and after of the browser bundle of each respective version:
| v3.0.2 | v3.0.3 | Delta | |
|---|---|---|---|
| svgo.browser.js | 643.5 kB | 651.7 kB | ⬆️ 8.2 kB |
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.