6 min read
2026-02-13
Remove unnecessary attributes, editor metadata, and empty groups. This reduces file size by 30-60%.
The viewBox attribute defines the SVG coordinate system. Always specify it for correct scaling.
Use `
Instead of fill and stroke attributes in SVG, use CSS classes. This allows you to change icon colors on hover.
Combine the icons into an SVG sprite and link via `
CSS animations for SVG are simpler and more performant than SMIL. Use `transition` and `@keyframes`.
| Action | Savings |
|---|---|
| Removing metadata | 10-30% |
| Rounding coordinates | 5-15% |
| Removing empty attributes | 5-10% |
| Minification | 10-20% |
| Gzip compression | 60-80% |
See also: Favicon Generator, Base64 Image