HandyBench

SVG to PNG Converter

Render SVG markup or files to a crisp PNG.

How to use the SVG to PNG Converter

  1. 1 Choose an .svg file, or paste raw SVG markup and click Render SVG.
  2. 2 Set the output width and height (or keep the detected intrinsic size).
  3. 3 Pick a transparent or white background, then download the PNG.

Rasterising an SVG

An SVG is XML that describes shapes, paths and text, so it has no fixed pixel size until something draws it. This tool loads your markup as an image, then paints it onto a canvas whose width and height you choose and exports the canvas as PNG. Because the drawing is re-done at the target size, rather than enlarged afterwards, edges stay sharp even at big sizes. The preview is capped to 420 px on screen, but the download uses the exact numbers in the width and height boxes.

Where the starting size comes from

  1. The width and height attributes of the root element, if both are positive numbers.
  2. Otherwise the third and fourth numbers of the viewBox.
  3. Otherwise the size the browser decoded, and as a last resort 300×150.

Unit suffixes are converted to CSS pixels at 96 per inch: px, in, cm, mm, pt, pc and em all work, so width="2cm" becomes 76 px. A percentage such as width="100%" has no fixed size, so the tool falls back to the viewBox (and, if only one side is a percentage, derives it from the viewBox ratio). You can always type the exact size yourself.

Worked example

An icon with viewBox="0 0 24 24" and no width or height starts at 24×24. To get a crisp 512×512 PNG, set the width to 512; with the lock on, the height follows to 512. That is a scale of about 21.3 times, with 262,144 pixels in the result. A 1200×630 social image would need width 2400 to give a 2x export for high-density screens (height 1260). The file is named like converted-512x512.png.

What does not render

SVG contentResult
Inline shapes, gradients, clip pathsDrawn normally
Images embedded as data: URIsDrawn
Linked images (href="https://...")Usually blank, since browsers block external loads in SVG used as an image
Web fonts via @import or @font-face URLsNot fetched, so text falls back to a system font
Scripts and animationsIgnored; you get a static frame

For exact typography, convert text to outlines in your design tool before exporting the SVG.

Common mistakes

  • Pasting markup without the namespace. The root element needs xmlns="http://www.w3.org/2000/svg", or the browser will not treat it as an image and you will see the parse error. Press Render SVG after pasting.
  • Forgetting the background. The default is transparent. Choose White if the PNG will sit on a dark or unknown background and you do not want a see-through logo.
  • Setting an enormous size. A 10000×10000 export needs 400 MB of canvas memory and may be refused by the browser.

Need an icon set instead of one image? See App Icon Generator, or resize a raster file with the Image Resizer.

Examples

  • ▸ A viewBox 0 0 24 24 icon exported at width 512, giving a 512 by 512 PNG.
  • ▸ A 1200 by 630 social-card SVG exported at width 2400 for a 2x version, 2400 by 1260.
  • ▸ A logo with a transparent background rendered on white for a form that rejects transparency.

Frequently asked questions

Why convert SVG to PNG?

SVG is not accepted everywhere: some CMS uploaders, email clients and social platforms take only raster formats. PNG also fixes a vector at one exact pixel size.

How is the initial size determined?

The tool reads the root width and height attributes, then falls back to the viewBox, then to the size the browser decoded. Units (px, in, cm, mm, pt, pc, em) are converted to CSS pixels at 96 per inch. A percentage such as 100% has no fixed size, so the tool uses the viewBox instead. You can always type the size you want in the fields.

Will the PNG look blurry if I scale it up?

No. The SVG is redrawn at your chosen pixel size rather than stretched afterwards, so edges stay crisp. Very large sizes are limited by browser memory.

Why is my pasted SVG not rendering?

The root element must carry xmlns="http://www.w3.org/2000/svg" and the markup must be valid XML. After pasting, press Render SVG to load it.

Why are my fonts or linked images missing?

The SVG is drawn as an image, where browsers do not fetch external fonts or pictures. Embed images as data URIs and convert text to outlines before exporting.

Is my SVG uploaded anywhere?

No. The file or markup is rendered locally on a canvas and never leaves your device.