SVG to PNG, JPG and WebP converter

Turn an SVG into a PNG, JPG or WebP at any size, with or without a background.

Converted image

Choose an SVG file or paste its code to see the image.

What this tool does

An SVG is a drawing described in text: shapes, paths and colours rather than pixels. That is why it stays sharp at any size, and also why many places will not take it. Social networks, e-mail clients, slide decks, app stores and most upload forms want a PNG, a JPG or a WebP. This tool draws your SVG at the pixel size you choose and saves it in one of those three formats.

Everything happens in your browser. The file is read on your device, drawn on a canvas and encoded there, so nothing is uploaded and there is no queue.

How to convert an SVG

  1. Drop the file on the box, choose it, or paste the SVG code into the text field. The "Try an example" button loads a small icon so you can see the result straight away.
  2. Pick the format. PNG is lossless and keeps transparency, WebP is smaller and also keeps transparency, JPG is the smallest for photographs but has no transparency at all.
  3. Choose the size, then download. The preview updates as you change anything, and the line under it shows the pixel size and the file size of what you will get.

Choosing the size

An SVG does not have pixels of its own, so you decide the size. There are three ways to say it: a scale (times the natural size), an exact width, or an exact height. With a width or a height the other side follows the aspect ratio, so the picture is never stretched.

The natural size is read from the file. If the root element has width and height, those are used. If it only has a viewBox, which is common for icons, the viewBox gives the size and the ratio: an icon with viewBox="0 0 24 24" is 24 by 24 pixels at scale 1, 96 by 96 at scale 4 and 512 by 512 when you ask for a width of 512. A wide logo with viewBox="0 0 24 12" at a width of 480 comes out 480 by 240. If a file has neither a size nor a viewBox, the tool assumes 300 by 150, as browsers do, and says so.

The longest side can be up to 8192 pixels, and the whole image is limited to about 50 million pixels, which is what a browser can draw reliably.

PNG, JPG or WebP

  • PNG for logos, icons and anything with sharp edges or transparency. Files are larger, but nothing is lost.
  • WebP for the same pictures when the place you upload to accepts it: it is usually much smaller than PNG and keeps transparency. The quality slider applies.
  • JPG only when a destination insists on it. It has no transparency, so the tool always fills the background with a colour (white by default) and the quality slider applies. Hard edges and flat colours show faint blocky noise at low quality.

For a transparent background, leave the "Transparent background" switch on and choose PNG or WebP. Switch it off to fill the image with a colour of your choice.

SVG is not only a picture: the format allows scripts, event handlers and links to other files. An SVG from an unknown source should be treated like any other file you do not trust. Here the file is loaded only as an image, which a browser never lets run code, and before that the tool removes script elements, embedded frames, event attributes such as onclick, links to other web addresses and CSS imports. The count is shown, and none of it is ever executed.

When the result looks wrong

  • Text turns into a different font. An SVG drawn as an image cannot load fonts from the web. Convert the text to outlines in your drawing program first, or embed the font.
  • The picture is blank. Check that the markup is complete and that the root element is svg. Pasted code without the xmlns attribute is fixed automatically, but a missing closing tag is not.
  • An external image is missing. Images that point to other web addresses are removed on purpose. Embed them as data in the file instead.
  • The edges look soft. Raise the size. Scaling up an SVG is lossless, scaling up the exported PNG is not.

Frequently asked questions

Is my SVG uploaded anywhere?

No. The file is read in your browser, drawn on a canvas on your device and encoded there. Nothing is sent over the network.

Can an SVG with a script harm me here?

The tool never runs scripts. It removes script elements, event attributes and links to outside files, and then draws the file as an image, which browsers do not let execute code.

Why is my PNG not transparent?

Check that "Transparent background" is on and that the format is PNG or WebP. JPG cannot be transparent, so a JPG always gets a background colour.

My SVG has only a viewBox and no width or height. Will it work?

Yes. The viewBox gives the natural size and the aspect ratio, and you choose the pixel size. If neither a size nor a viewBox exists, 300 by 150 is assumed.

What is the largest size I can export?

The longest side can be 8192 pixels and the image can have about 50 million pixels. Beyond that browsers fail to draw the canvas, so the tool asks you for a smaller size instead.