SVG to PNG converter
Runs entirely in your browser. Your files and data never leave your device.
About this tool
This tool turns an SVG vector graphic into a PNG raster image. Drop an SVG file or paste its markup, pick a scale (or type a custom width), and download the PNG.
How does it figure out the right size?
It reads the SVG’s own width and height attributes if both are set to absolute values like 120px or 48. If either is missing or given as a percentage, it falls back to the viewBox attribute, deriving the missing side from its aspect ratio when only one dimension is usable. If the file has none of those, it uses 300x150, the same default browsers use for an <img> with no size specified. From there, picking a 1x, 2x, or 4x scale multiplies that base size, or you can type a custom width and the height follows the same aspect ratio automatically.
Is the SVG uploaded anywhere?
No, everything happens on your device. The browser draws the SVG into a hidden canvas element and reads the pixels back out to build the PNG, so the file never gets sent to a server. This also means the SVG is treated purely as an image: any <script> tags or event handlers embedded in it don’t run, since rendering to a canvas doesn’t execute the document the way adding it to a page would.
What can go wrong with malformed SVG?
The converter needs markup that at least contains a recognizable <svg> opening tag; text that doesn’t look like SVG at all is rejected before anything gets drawn. Beyond that, rendering is left to the browser’s own SVG engine, so most well-formed SVG (including nested groups, gradients, and embedded fonts or images) renders the same way it would if you opened the file directly. Genuinely broken XML, unlike a missing width or height, will still fail to render since the browser can’t parse it into a document at all.
When would you use this?
Use it to turn a logo or icon into a PNG for a place that doesn’t accept SVG, such as an old CMS, an email signature, or a game engine. You can also export the same icon at 1x, 2x, and 4x for different screen densities, which is handy for app icons or favicons that need several fixed-size PNGs. For background on the two image formats and when to reach for which, see MDN’s guide to image file formats.