Skip to main content
SiteIndex
开发者可以使用

优化您的SVG文件

在浏览器中使用SVGO优化SVG,预览代码、比较文件大小并下载优化后的矢量图。

使用指南

交互式工具区

无需注册账号

Optimize SVG files

Core processing uses local browser APIs and libraries, without a file-upload endpoint. One file at a time, up to 20 MB; images up to 40 megapixels and 8,192 pixels per side. OCR may download an engine and the selected language data from external asset hosts and stops after two minutes per file. Optional analytics and advertising have separate consent and privacy disclosures. Use synthetic files.

2–3 decimals is visually safe for most graphics; use 1 for tiny icons and 4 when fine detail matters. The viewBox is always kept, so optimized files stay responsive.

What this optimizer removes

Removed or simplifiedWhy it is safe
Editor metadata & commentsInkscape, Illustrator, Sketch, and Figma data is never rendered by browsers.
Unused defs & IDsUnreferenced IDs are shortened or dropped; referenced ones are kept working.
Default & redundant attributesAttributes that repeat the SVG default value add bytes without changing the render.
Excess coordinate precisionRounding to 2–3 decimals is invisible at normal display sizes and shrinks path data the most.
Empty groups & containersGroups with no rendered children cannot affect the picture.

Typical savings are 30–70% with no visual change. The viewBox is always kept so the file still scales; optimization runs entirely in your browser and files are never uploaded.

Common questions

Will it change how my SVG looks? Light and Moderate only remove non-rendered data and round coordinates; compare the rendered preview (or overlay mode) before downloading if the artwork is intricate.

Why is the viewBox kept? Without it the SVG loses its responsive scaling and can render at the wrong size on web pages.

Icons or illustrations? Icons gain the most from Aggressive (merged paths, collapsed groups); detailed illustrations are safer on Moderate.

SVG优化器是什么?

在浏览器中使用SVGO优化SVG,预览代码、比较文件大小并下载优化后的矢量图。

工作原理

在浏览器中使用SVGO优化SVG,预览代码、比较文件大小并下载优化后的矢量图。

常见用途

在浏览器中使用SVGO优化SVG,预览代码、比较文件大小并下载优化后的矢量图。

使用限制

结果可能因浏览器、网络、输入内容和外部服务而异。本工具仅供参考,不能替代专业诊断或建议。

常见问题
SVG优化器是什么?
在浏览器中使用SVGO优化SVG,预览代码、比较文件大小并下载优化后的矢量图。

相关工具