SVG to PNG
Published Updated
Convert SVG to PNG at any size, with transparency kept — free and processed entirely in your browser.
About SVG to PNG
SVG to PNG conversion turns a Vector. An image stored as drawing instructions (shapes, curves, fills) instead of pixels, so it can be drawn at any size without blur. SVG is the web's vector format. Read the guide drawing into a regular bitmap image that works anywhere a PNG does: slides, social posts, app stores, email signatures and printers that do not understand vector files. This converter draws your SVG at the exact size you choose, keeps its transparency, and saves the result as a PNG.
An SVG has no fixed pixel size, so you decide how big the PNG should be. Pick a scale such as 2x for sharper screens, or type a width in pixels and let the height follow the drawing's proportions. If the file does not declare a width and height, the tool reads its viewBox instead, and if there is neither it starts from a 300 by 150 canvas that you can scale up. The background stays transparent by default, which is what you want for logos and icons. Switch to a solid color when the place you are posting it cannot show transparency. Output is limited to 10,000 pixels per side and 50 megapixels in total, so your browser stays responsive.
SVG files can contain scripts. This tool removes them before drawing, and the file is cleaned of scripts, event handlers and links to outside files, then drawn through an image element, where MDN notes that JavaScript is disabled (see the test above). Fonts that are linked from outside the file cannot be loaded, so convert text to outlines before exporting if the lettering must match. The file is processed in your browser; this page does not upload it to our servers, and no account is needed. To save as a JPG instead, use our SVG Converter, and to shrink the SVG itself, try our SVG Optimizer.
From the SVG's declared size to PNG pixels
An SVG has no pixel size of its own, so the tool works one out from the root element before drawing. We gave the page's real converter nine versions of the same two-colour drawing with different root attributes and saved each at 1x and 2x with its own buttons, in Google Chrome 156, Chromium 153 (Playwright build, not Google Chrome), Firefox 155 and Playwright's WebKit build (not the Safari app). All four engines gave the same pixel sizes, and in every PNG the drawing filled the frame (red top-left quarter, blue elsewhere):
| Root of the SVG | PNG at 1x | PNG at 2x |
|---|---|---|
width="200" height="100" | 200 x 100 | 400 x 200 |
width="2in" height="1in" | 192 x 96 | 384 x 192 |
width="150pt" height="75pt" | 200 x 100 | 400 x 200 |
width="50mm" height="25mm" | 189 x 94 | 378 x 189 |
width="10em" height="5em" | 160 x 80 | 320 x 160 |
width="100%" height="100%" with viewBox="0 0 640 480" | 640 x 480 (percentages ignored, viewBox used) | 1280 x 960 |
Only viewBox="0 0 64 32" | 64 x 32 | 128 x 64 |
width="400" with viewBox="0 0 200 100" | 400 x 200 (height from the viewBox shape) | 800 x 400 |
| No width, height or viewBox | 300 x 150 | 600 x 300 |
The units follow the CSS rule that CSS Values and Units Level 4 (W3C Working Draft) writes as "1in = 2.54cm = 96px", with a point being 1/72 of an inch; the tool counts an em as 16 pixels. Each side is rounded on its own, so 50 x 25 mm came out 189 x 94 rather than 2 to 1, and at 1x one edge row of that PNG was partly transparent (188 pixels) in all four engines.
Scripts, outside files, filters and animation: what reached the PNG
Fourteen small 200 x 200 test SVGs, each with one feature, converted at 1x with the default transparent background. Unless the row says otherwise the result was the same in all four engines named above.
| What the SVG contained | What the PNG showed |
|---|---|
| A script element, an onload and an onclick handler | Removed before drawing (the page said "Removed 3 unsafe items"); the red square drawn |
| An image linked from an http address | Link removed ("Removed 1 unsafe item"); that area left transparent, the rest drawn |
| A use element pointing at another file; a link with a javascript: address | Removed in both cases; the shapes around them drawn |
| An @import of an outside stylesheet with a web font | Import removed; the text drawn in a fallback font |
| An image embedded as a data: PNG | Drawn (the embedded green) |
| A Gaussian blur filter, a gradient clipped to a circle | Both drawn; transparent outside the circle |
| HTML inside a foreignObject | Chrome 156, Chromium 153 and the WebKit build: no PNG, the message "Your browser won't export this SVG as an image"; Firefox 155: drawn |
| An animation from red to blue (SMIL animate, or a CSS animation) | Red, the starting colour, in all four |
| A blue square at 50% opacity | Blue at alpha 128 on transparent; with Solid color white, 127,127,255 (Chromium 153, Firefox 155) or 128,128,255 (Chrome 156, WebKit build) |
None of the outside addresses in these files was requested: the page's own resource list held no request for them in any engine, and our test server logged none. That fits MDN's guide to SVG as an image, which says that for security purposes some browsers restrict SVG used as an image: "JavaScript is disabled", and outside resources "cannot be loaded, though they can be used if inlined through data: URLs". The tool removes those links before the browser sees them anyway.
How large a PNG, and how long it took
A 1000 x 1000 SVG, converted with the page's own buttons and width box. Time is from the click to the download link, one run each; PNG sizes differ because each browser has its own PNG encoder.
| Request | Chrome 156 | Chromium 153 | Firefox 155 | WebKit build |
|---|---|---|---|---|
| 4x: 4000 x 4000 (16 megapixels) | 0.44 s, 378,381 B | 0.12 s, 385,334 B | 0.43 s, 132,504 B | 0.69 s, 346,688 B |
| Width 7000: 7000 x 7000 (49 megapixels) | 0.49 s, 1,054,126 B | 0.22 s, 1,064,425 B | 1.00 s, 319,458 B | 1.54 s, 973,709 B |
| 8x: 8000 x 8000 | Button off: "8000 x 8000 px is 64.0 megapixels. The limit is 50." | Same | Same | Same |
| Width 10001 | Button off: "10001 x 10001 px is too large. The limit is 10,000 px per side." | Same | Same | Same |
How to Convert SVG to PNG
Step 1
Upload your SVG
Drag and drop an .svg file, or choose one from your device.
Step 2
Choose size and background
Pick a scale or type a width in pixels, and keep the background transparent or choose a solid color.
Step 3
Download your PNG
Save the finished PNG, or copy it straight to your clipboard.
Frequently Asked Questions
Is my SVG uploaded anywhere?
Not by this page. The SVG is read and drawn in your browser and the PNG is built there too, and no request carries the file to our servers. In our test the links to outside files inside our SVGs were removed before drawing, and none of those addresses was requested in any of the four browsers we ran.
What happens to scripts inside an SVG?
The tool removes scripts, event handlers and links to outside files first, then draws the picture through an image element, where MDN's guide to SVG as an image notes that JavaScript is disabled. An SVG with a script element, an onload and an onclick handler converted with the note "Removed 3 unsafe items" in Chrome 156, Chromium 153, Firefox 155 and the WebKit build, and the request its script would have made did not reach our test server.
How do I choose the size of the PNG?
Use a scale such as 1x, 2x or 4x of the drawing's own size, or switch to width mode and type the exact number of pixels you need. The height follows automatically.
Will the PNG keep a transparent background?
Yes, transparent areas stay transparent by default. If the place you are using the image cannot show transparency, choose a solid background color instead.
My SVG has no width or height. Will it still work?
Yes. The tool uses the viewBox to work out the size. If the file has neither, it starts from a 300 by 150 canvas, and you can scale or resize from there.
Why do the fonts look different in the PNG?
Fonts that are linked from outside the file cannot be loaded when an SVG is drawn as an image, so the browser falls back to a default font. Convert text to outlines in your editor, or embed the font in the SVG.
Why did my SVG give an error instead of a PNG in Chrome?
If it holds HTML inside a foreignObject element, that is the likely cause. Such an SVG was drawn, but Chrome 156, Chromium 153 and the WebKit build refused to export the canvas, and the page showed "Your browser won't export this SVG as an image". Firefox 155 saved it. Plain SVG shapes and text converted in all four.
Does an animated SVG convert at its last frame?
No. Both a SMIL animation and a CSS animation from red to blue came out red, the starting colour, in all four browsers. To get another moment of the animation, edit the SVG so that the colours or positions you want are the static ones.
How many pixels is an SVG measured in inches, points or millimetres?
The tool uses 96 pixels to the inch, as CSS does: 2 x 1 in became 192 x 96 pixels at 1x, 150 x 75 pt became 200 x 100, and 50 x 25 mm became 189 x 94 after rounding. Percent sizes are ignored in favour of the viewBox. Pick a scale or type a width to get a bigger PNG.
Why is the same PNG a different file size in each browser?
Each browser writes PNG with its own encoder. Our 200 x 100 two-colour test came out 898 bytes in Chrome 156 and Chromium 153, 847 in the WebKit build and 497 in Firefox 155; a 4000 x 4000 PNG ranged from 132,504 to 385,334 bytes.
Related guide
JPG, PNG, WebP, HEIC and SVG: which image format to use. The guide measures an SVG icon of 181 bytes against PNG versions of it at four sizes.