Skip to main content

SVG to PNG

New

Convert SVG markup or files to PNG images with custom output size.

svgpngconvertimage
Read the guide
Shortcuts:⌘ KSearch
No SVG file loaded.
Source
Natural size
Output size
PNG bytes
PNG preview
No render yet

Upload or paste SVG markup, then adjust the output size.

Frequently Asked Questions

How does the tool determine the natural size of my SVG?

It reads the width/height attributes on the root <svg> element first; if those are missing, it falls back to the viewBox dimensions, and computes whichever of width or height is absent using the viewBox aspect ratio. If neither is available, it defaults to 512×512.

What happens if I type an invalid width instead of using the scale slider?

The Output width field and the Scale slider are linked both ways — typing a width recalculates the equivalent percentage (rounded to the nearest 25%) and vice versa. Height is always derived automatically from the natural aspect ratio, so the image never distorts.

Is the PNG conversion done on a server?

No. The SVG is loaded into an in-memory <img>, drawn onto an HTML <canvas> at your chosen resolution, and read back out as a PNG data URL using canvas.toDataURL — all inside your browser tab. Nothing is uploaded anywhere.

What happens if my SVG markup is malformed?

The tool parses it with DOMParser first and checks for a parsererror node and a valid root <svg> element before attempting to render. If either check fails, you get a specific error message (e.g. "malformed XML" or "must contain a root <svg> element") instead of a blank canvas.

Can I see the resulting PNG file size before downloading?

Yes. After rendering, the panel shows the natural SVG size, the chosen output size, and the resulting PNG byte size (formatted as B/KB/MB) so you can judge whether to scale down further before downloading.

Related Tools