svg vs webp for websites
SVG vs WebP for Websites: Which Should You Use?
TL;DR. Use SVG for logos, icons, diagrams and flat illustrations: one small file stays sharp at every size and can be styled with CSS. Use WebP for photos, screenshots and textured artwork. Don't convert an SVG logo to WebP to satisfy PageSpeed: Lighthouse's modern-format check only flags BMP, JPEG and PNG.
Convert your file now →Use SVG for anything drawn from shapes: logos, icons, diagrams, flat illustrations. Use WebP for anything made of pixels: photos, screenshots, textured or painted artwork. The two don't compete for the same job. The hard calls are the images in between, and the one mistake that comes up most often is converting a perfectly good SVG to WebP because a speed tool suggested it.
SVG vs WebP at a glance
| SVG | WebP | |
|---|---|---|
| What it stores | Shapes as XML text | Pixels, lossy or lossless |
| Sharp at any size | Yes, one file | No, needs srcset sizes |
| Typical logo/icon size | 1–20 KB | Grows with pixel size |
| Photos | Poor and heavy | Excellent |
| Transparency | Yes | Yes |
| Animation | CSS or SMIL | Animated frames |
| Style with CSS | Yes, when inlined | No |
| Maximum size | None | 16,383 × 16,383 px |
MDN's image format guide describes SVG as ideal for "user interface elements, icons, diagrams, etc., that must be drawn accurately at different sizes", and lists WebP's limits as 16,383 pixels per side with lossy (VP8) or lossless compression.
Is the image made of shapes or pixels?
This is the deciding factor nine times out of ten. An SVG stores instructions: a path, a fill colour, a curve. A browser redraws those instructions at the size the layout needs, so the same file is sharp on a phone and a 5K monitor.
WebP stores a grid of colour values. It compresses that grid well, often better than PNG or JPEG, but the grid has a fixed size. Display it larger than it was exported and it softens; on a 3x phone screen you need a file three times as wide to look crisp. For a photo, that's fine and unavoidable. For a logo, it means shipping several WebP files to do what one SVG already does.
When does an SVG end up heavier than a WebP?
When the image has more detail than shapes can describe cheaply. The web.dev guide to image formats puts it plainly: for complex scenes, "the amount of SVG markup to describe all the shapes can be prohibitively high."
Watch for these in-between cases:
- Illustrations with soft shading or texture. Flat-colour art stays small as SVG. Add brush texture, grain or photographic shading and the path count explodes. Export these as WebP.
- Traced photos. A photo run through a vectorizer becomes thousands of small paths, often several times the size of a WebP of the same photo, and it looks worse. Our post on why an SVG file gets so large explains the mechanism.
- SVGs with an embedded image. Some editors save a raster inside the SVG as base64 text. You get the weight of a raster with none of the vector benefits, so export the raster part as WebP instead.
A quick test: export both and compare. If the SVG is under about 20 KB, keep it. If it's several times larger than a WebP that looks identical at the size you display it, the image is really a raster and WebP is the better format.
Should I convert my SVGs to WebP for PageSpeed?
No. Lighthouse's "Serve images in modern formats" audit, now folded into its "Improve image delivery" insight, only collects BMP, JPEG and PNG images. SVGs are never flagged by it. Converting a logo to WebP to clear the warning fixes nothing the audit measures and gives you a blurrier logo that needs multiple sizes.
What the audit does catch is PNG and JPEG photos. Those are the files to move to WebP.
What about browser support?
Neither format is a compatibility concern on today's web. SVG has rendered
natively in every major browser for over a decade. WebP works in all current
versions of Chrome, Edge, Firefox, Opera and Safari, with one caveat MDN notes:
on a Mac you need Safari 14 or later and macOS Big Sur or later. If you
still serve visitors on older Macs, put WebP inside a <picture> element with a
JPEG or PNG fallback.
How do the two work together on one page?
A typical page uses both:
- Logo, icons, UI shapes: SVG. Inline the icons you want to recolour with
CSS (for example with
fill: currentColorso they follow the text colour in both themes); use<img src="logo.svg">for the rest. - Hero photo, product shots, screenshots: WebP, with
srcsetwidths so phones don't download desktop-sized files. - Favicon: SVG for modern browsers, plus a PNG fallback. See how to make an SVG favicon from a PNG.
The same split applies to the older formats: PNG vs SVG for the web covers when PNG is still the right pick.
If your logo or icon only exists as a WebP, you can trace it into an SVG with the WebP to SVG converter: the watermarked preview is free, and the clean SVG costs one credit.
Frequently asked questions
- Is WebP better than SVG for a website logo?
- No. A logo is made of flat shapes, so as an SVG it is usually a few kilobytes and stays sharp on every screen without extra files. A WebP logo is a fixed grid of pixels, so you need a 2x or 3x version for high-density screens and it still blurs past its native size.
- Does Google PageSpeed want me to convert SVG to WebP?
- No. Lighthouse's 'Serve images in modern formats' check, now part of the 'Improve image delivery' insight, only collects BMP, JPEG and PNG images. An SVG is never flagged by that check, so converting it to WebP gains nothing for the audit and loses scalability.
- Can WebP replace PNG for transparent graphics?
- For raster graphics, yes. WebP supports transparency and is usually smaller than the equivalent PNG. If the graphic is a flat logo or icon, though, an SVG is the better replacement for both.
- What if my logo only exists as a WebP file?
- Trace it into an SVG. Vectorizing works well on logos and flat art with clear edges and few colours. Use the largest WebP you have, because a small or heavily compressed source gives rougher traced edges.
Ready to convert?
Drop your file, preview the trace free, and download a clean SVG.
Open the converter →