FLXCode SVG to PNG Converter

FLXCode apps

Appearance

SVG to PNG Converter

Turn an SVG into a PNG at the size you need. The SVG is drawn on your device and never uploaded.

or drop it here, or paste the code below

The SVG is drawn as a picture, so scripts inside it never run, and files it points to on other sites are not loaded. Fonts the SVG needs must be installed on this device.

No ads. No account. Nothing you type or record is uploaded. We count page events with a daily code. Check it.

Problem or idea? Email us

Quick start

  1. Choose an SVG file, drop it on the page, or paste the code. Try a sample if you have none.
  2. Pick a scale such as 2x or 4x, or switch to Width in px and type the width you want.
  3. Keep the background transparent, or pick a color.
  4. Press Download PNG.

How the size is worked out

An SVG has no pixels of its own, so the tool reads the size it asks for. Examples from the tool's own code:

Opening tagSize at 1xWhy
<svg viewBox="0 0 24 24">24 x 24 pxonly a viewBox
<svg width="2in" height="1in">192 x 96 pxsizes in inches
<svg width="48" height="48" viewBox="0 0 24 24">48 x 48 pxwidth and height win over the viewBox
<svg width="200" viewBox="0 0 100 50">200 x 100 pxone side given, the other from the viewBox
<svg width="100%" height="100%">300 x 300 pxpercent sizes, no viewBox

An icon with a 24 x 24 viewBox gives these PNG sizes:

ScalePNG size
1x24 x 24 px
2x48 x 48 px
4x96 x 96 px
8x192 x 192 px
16x384 x 384 px

A logo with a 120 x 40 viewBox, saved at a width of 1200 px, comes out 1200 x 400 px.

How it works

The tool sets the output width and height on the root tag, so the browser draws the vector at the final size and does not stretch a small bitmap. If the file has no viewBox, one is added from the old size. Here is the tag for the 24 x 24 icon at 4x: <svg xmlns="http://www.w3.org/2000/svg" width="96" height="96" viewBox="0 0 24 24">. The result is drawn on a canvas, filled with your background color if you picked one, and saved as PNG.

What an SVG can and can't do here

The file is turned into a blob address and drawn through an image element. In that mode browsers don't run scripts or follow links, and this page's content security policy blocks loads from other sites. So a file from someone else can't run code on this page, and it can't phone home to fetch parts. Parts that depend on outside files are simply missing from the PNG.

Numbers this uses

  • CSS units at 96 dpi: 1 in = 96 px, 1 pt = 1.333 px, 1 pc = 16 px, 1 cm = 37.8 px, 1 mm = 3.78 px (CSS Values and Units).
  • No size and no viewBox: 300 x 300 px, the same default as a browser picture of that kind.
  • Limits: 8192 px per side, 64 megapixels, a 5 MB file (this site's limits for phone memory).

Privacy

Nothing you choose or paste is uploaded or stored. We count events without cookies, such as "PNG saved" (details).

FAQ

How do I convert an SVG to PNG?

Choose the SVG file, or paste its code, pick a scale or a width, and press Download PNG. The browser draws the SVG at that size and saves it, so the lines stay sharp.

What size will the PNG be?

It uses the size the SVG declares in its width and height, or the viewBox if there are none, multiplied by the scale you choose. Or type the width you want and the height follows the shape. The line under the controls shows the exact pixels.

How do I keep the background transparent?

Leave Background on Transparent. The PNG keeps its alpha channel and shows as a checkerboard in the preview. Choose Color if the place you upload to puts a black background behind transparent PNGs.

What is the biggest PNG I can make?

Up to 8192 pixels on a side and 64 megapixels in total. That limit keeps the page from running out of memory on a phone. For a bigger picture, convert a smaller one and upscale it in an editor, or use a vector format.

Can scripts in an SVG run here?

No. The SVG is drawn as a picture, and browsers do not run scripts in a picture. The page rules also block it from loading files from other sites, so an SVG that links to an outside image or font gets those parts left out.

Why does my text come out in a different font?

An SVG that names a font draws it only if the font is installed on this device. Web fonts linked from another site are blocked. Convert the text to outlines in your editor first, or embed the font in the file.

Why does my SVG come out blank or fail?

Check that it starts with an svg tag, has the xmlns attribute, and is complete. An SVG that uses foreignObject may fail in Safari when saving. A file over 5 MB is refused.

Is my SVG uploaded?

No. It is read and drawn by your browser on this device. The code is not sent, saved or put in the address bar.

More from FLXCode

Share SVG to PNG Converter