SVG to WebP
Pick an .svg file or paste SVG markup and rasterise it to WebP in the browser with <img> + <canvas>: choose the export size, quality and scale, keep alpha by default or flatten it onto a background colour. The result rows show the real pixel size and the encoded byte count — exactly the WebP bytes you download.
Runs in your browserEvery computation happens in your browser — your data never leaves this device.
The SVG file or markup is rasterised locally with <img> + <canvas> and encoded to WebP — nothing is uploaded.
The bitmap is not previewed here: press Export & download for the real WebP; the parameters are below.
Real export result
Size, quality and file name are the real parameters of the downloaded WebP.
Pick a file or paste markup and the real export parameters show up here.
What this tool does
- Export an SVG icon as a bitmap for an image host or document that only accepts WebP.
- Need a transparent asset: WebP keeps alpha, so there is no cut-out step like with JPEG.
- Export at 2× for HiDPI screenshots or app icon source art.
- Just want a different background: flatten the SVG onto a colour and export.
Example
Input
<svg xmlns="http://www.w3.org/2000/svg" width="240" height="160" viewBox="0 0 240 160"><rect width="240" height="160" fill="#0ea5e9"/><circle cx="120" cy="80" r="48" fill="#facc15"/></svg>
Output
Export size: 240 × 160 · Quality: 80 · Real WebP size: 1590 B (153600 B uncompressed) · alpha preserved; the file is named image-240x160-q80.webp
The size comes from the width/height attributes; the transparency option switches between keeping alpha, white, black and a custom colour. You can also pick an .svg file directly — its name becomes the export name prefix (for example a-240x160-q80.webp). The byte count is what the browser really encoded.
Frequently asked questions
Why is my exported WebP transparent?
WebP supports alpha, so the transparent channel is kept by default. Change "Background for transparency" from Keep transparent to white or a custom colour to flatten it.
How is the export size computed?
Leave both fields blank to use the SVG width/height (then viewBox, then a 300 × 150 fallback). Fill one side and the other follows the aspect ratio. Fill both and the width wins so the image is never stretched. Anything over 8192 px or 40 megapixels is scaled down.
Why does rendering fail?
Usually a missing xmlns="http://www.w3.org/2000/svg", or external images/fonts. When the browser loads an SVG as an image it neither runs scripts nor fetches cross-origin resources, so those files render blank.
What quality should I use?
80–90 is visually lossless for photos; flat icons and line art can go to 90–100 and stay small. Lossy WebP is typically 25–35% smaller than JPEG at the same perceived quality.
Keywords:svg2webpwebpcanvas toBlob