Skip to content
UniKit

SVG to JPG

Pick an .svg file or paste SVG markup and rasterise it to JPEG in the browser with <img> + <canvas>: choose the export size, quality and scale, and flatten transparency onto white, black or a custom colour (JPEG has no alpha). The result rows show the real pixel size and the encoded byte count — exactly the file 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 never uploaded.

Exported bitmap

The bitmap is not previewed here: press Export & download for the real JPEG; the parameters are below.

1×
90%

Real export result

Size, quality and file name are the real parameters of the downloaded JPEG.

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 a chat window or document that only accepts JPG.
  • Produce a cover image at a fixed pixel width: set the width and the height follows the aspect ratio.
  • Prepare assets for legacy systems that cannot render SVG — export the sizes you need.
  • Transparent SVGs turn black in JPEG, so the tool paints the background first.

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: 90 · Real bitmap size: 3065 B (115200 B uncompressed) · flatten colour rgb(255, 255, 255); the file is named image-240x160-q90.jpg

The size comes from the width/height attributes; the background option switches between 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-q90.jpg). The byte count is what the browser really encoded.

Frequently asked questions

Why is the JPG background white (or black)?

JPEG has no alpha channel. If the SVG has transparent areas and is encoded directly, browsers treat transparency as black, so the tool fills the canvas with the chosen colour before drawing. Export PNG or WebP if you need transparency.

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 want 92–100 or the edges show JPEG ringing. Busy line art is better off as PNG.

Keywords:svg2jpgcanvas toBlob

Related tools