🗜️ SVG Minifier
📐 工作原理與說明
壓縮比 = (1 − 壓縮後位元組數 ÷ 原始位元組數) × 100%;四種可選規則:剔除 <!--…--> 註釋、剔除 <?xml…?> 與 DOCTYPE 宣告、剔除 <metadata>…</metadata> 後設資料、摺疊空白(> 與 < 之間空白刪除、連續空白壓成單空格、去首尾空白);位元組數按 UTF-8 編碼後長度計
本工具為純前端線上工具,資料在瀏覽器本地處理、不上傳伺服器,依據對應領域標準與規範進行計算或處理,結果僅供參考。 工具名稱:SVG 壓縮 - 免費圖片處理工具,線上SVG 壓縮,免費使用。
Paste SVG code to strip comments, XML declarations, metadata and redundant whitespace, then compare the before/after rendering side by side.
原始圖形
壓縮後圖形
📚 深度解析:SVG 壓縮
💡 常見使用場景
- 精簡圖示。
- 減小資源。
- Inline SVG 最佳化。
壓縮圖示 SVG
輸入:貼上 SVG。
處理:去註釋/空格/合併路徑。
輸出:更小 SVG 可複製。
❓ 常見問題(FAQ)
- 會改形狀嗎?
- 僅去冗餘不刪路徑;如結果異常請保留原檔案核對。
- 能處理內聯 SVG 嗎?
- 支援貼上 inline SVG;過大檔案建議先分段再壓縮。
- 會儲存或上傳我的內容嗎?
- 結果以瀏覽器即時計算為準,純前端本地處理、資料不上傳;生成的樣式與程式碼僅作快速產出參考,正式專案請以設計系統、規範與瀏覽器實測為準。
Formula & Standard References
| Item | Formula / Note | Source / Standard |
|---|---|---|
| Redundancy removal | strip editor metadata, comments and empty groups | W3C SVG 1.1 |
| Numeric precision | two or three decimals of coordinates are usually enough | W3C SVG 1.1 |
| Transport compression | gzip on text SVG often removes sixty to eighty percent | RFC 1952 (gzip) |
⚠️ 使用說明與注意事項
- 本工具純前端執行,資料不會上傳到伺服器
- 建議在主流瀏覽器(Chrome/Safari/Firefox/Edge)中使用
- 計算結果僅供參考,請以實際應用場景為準