SVG Code to PNG

Paste SVG code, see it drawn as you edit, and download it as a PNG. A mistake in the code is named by its line and column. It runs in your browser, with no signup.

Paste SVG code here

Paste the code with Ctrl+V or ⌘V, or drop a file. SVG up to 20 MiB.

Drawn in this browser. Your code is not uploaded.

Options

Higher scales give a sharper image for retina screens and print.
Transparent keeps the see-through areas. Pick a colour to fill them.

Next step

SVG up to 20 MiB. A job stops after 60 seconds.

How to turn SVG code into a PNG

  1. Add your code. Paste the SVG code anywhere on this page with Ctrl+V or ⌘V or the Paste button, drop an SVG file on the mat, or press Choose file. To see how it works first, press Try a sample for the code of a small sun icon.

  2. Edit it and watch the picture. The code opens in an editor above its picture, and the picture is drawn again a moment after you stop typing. When a line has a mistake, the editor marks it and the status bar names the line, the column and what is wrong. Pick the Scale and the Background as you go.

  3. Download the PNG. Press Download PNG for a PNG named after the file. Where your browser allows it, Copy image on the picture puts the PNG on the clipboard, to paste straight into another program.

What the options do

Scale
How many times the SVG's own size the PNG is drawn. 2× doubles the width and the height; Width sets an exact width instead.
Width
The width of the PNG in pixels. The height follows, so the picture keeps its shape.
Background
Transparent leaves the empty areas see-through. Pick a colour to fill them instead.

Questions

Why does it say there is an error on a line?

The code is read as XML, which is strict about a few things. Every tag must be closed, every attribute value must be in quotes, and a lone & must be written &. The editor marks the first line it could not read and the status bar says what is wrong there; the picture keeps the last version that worked until you correct it, and there is nothing new to download until then.

How big will the PNG be?

At 1× the PNG has the size the SVG gives itself, its width and height or else its viewBox, counted at 96 pixels per inch. Code with neither is drawn at 300 × 150 pixels, as a browser would. Scale multiplies that size, and Width sets the width you type, with the height kept in proportion. The readout under the picture states the PNG's size in pixels.

How do I get a sharper PNG for high-resolution screens?

Set Scale to 2× or 4×. The SVG is drawn again at that size, so edges stay sharp instead of being stretched from a small image. A very large PNG can exceed what your browser can draw; the page then says so, names the largest size it can make and offers a button to use that size.

Why is my text in a different font, or a picture missing?

The code is drawn as an image, which never loads anything from the internet. Text uses the fonts installed on your device, so a web font the code links to is replaced. Pictures embedded in the code as data URLs are drawn, but pictures linked by a web address are left out. For the same lettering everywhere, convert the text to paths in your drawing program.

Can I copy the PNG instead of downloading it?

Yes, in browsers that allow a page to put an image on the clipboard. Press Copy image at the corner of the picture, then paste into a document, a chat or an image editor. Where the browser does not allow it, the button is not shown and the download works as usual.

Is my code sent to a server?

No. Your browser reads the code and draws the PNG itself, so the code and the picture never leave your device. Scripts in the code do not run and nothing it links to is fetched.

Related tools

Limits

SVG file20 MiB. A larger file is not converted and you are told why.
Several filesOne file at a time.
TimeA single job is stopped after 60 seconds.
BrowserNeeds Web Workers, OffscreenCanvas, and createImageBitmap. Current Chrome, Edge, Firefox and Safari have them.