SVG to PNG
How to convert SVG to PNG
- Add your SVG files by dropping them on the box above or clicking it. You can add up to 50 at a time.
- Choose how to size the PNG. Scale 1 keeps the SVG's own size, 2 doubles it. Or switch to pixels and type a width, a height, or both.
- Leave the background on Transparent, or pick Solid colour and enter a code such as #ffffff.
- Press Convert to PNG. Each result lists the old and new size in pixels.
- Save the PNGs one by one, or take them all with Download all as ZIP.
What this SVG to PNG converter does
An SVG is a drawing described in text. A PNG is a grid of pixels. This page turns the first into the second: your browser draws the SVG at the size you ask for, and the picture is saved as a PNG. No conversion library is involved, so the result looks the way your browser shows that SVG.
Only SVG files are accepted. We dropped a PNG on the page and got "this file type is not supported here." A broken file, or an HTML page renamed to .svg, gets "this is not a valid SVG file." Each PNG is named after its SVG plus its size, so shapes.svg at 3x becomes shapes-1200x720.png and the original is left alone.
For raster pictures there is no vector to redraw, so resizing is a different job: use the image resizer. To embed an SVG as text in code, see image to Base64.
Choosing the size, and why a PNG looks blurry
A PNG has a fixed number of pixels. If you export a 400 pixel logo and then stretch it to 1200 in a document, it goes soft, because the PNG has no more detail to give. The fix is to make the PNG big enough before you place it.
With Size by: Scale, the factor multiplies the SVG's own size (from 0.1 to 20). With Pixels, give a width, a height, or both. One value works out the other from the drawing's proportions. With both filled in and Keep the proportions on, the drawing is fitted inside that box, so a 500 by 500 box on our 400 by 240 sample gave a 500 by 300 PNG. Switch the box off and you get exactly 500 by 500, with the drawing stretched.
For sharp results on high-density screens, 2x of the displayed size is a common choice, and 3x suits some phones. For print, work out the pixels from the print size and the printer's resolution, then type them in.
The PNGs this page writes carry no resolution (DPI) setting. We read the chunks of every output and found only the image data, nothing that stores dots per inch. Software that places the picture decides its printed size, so give it the pixel count you need.
Transparent or solid background
The default is a transparent background. In our test the top-left pixel of the shapes.svg PNG read back as 0, 0, 0, 0, so it is fully see-through, while a pixel inside the blue circle was 21, 88, 200 and fully opaque. Edges of shapes are smoothed, so they blend into whatever sits behind the PNG.
Choose Solid colour when the PNG goes somewhere that mishandles transparency, such as an email template, or a form that turns see-through areas black. Type a code like #ffcc00. The short form #fc0 works too and is read as #ffcc00. A word such as "blue" gets "The background colour must be a colour code like #ffffff." The corner pixel of the yellow run read back as 255, 204, 0, 255.
If you want a JPG instead of a PNG, make the PNG here and open PNG to JPG. JPG cannot be transparent, so that page asks for a background colour too.
Fonts and linked images: what does not load
An SVG can point at a web font or at a picture on another site. This page draws the SVG as a standalone image, and the browser does not fetch anything for it, which is also what keeps your file private. Text then falls back to a default font, and linked pictures are left out.
We tested a file that imports a stylesheet from fonts.example.invalid and links a PNG from images.example.invalid. It converted to a 400 by 160 PNG. The text used the generic serif that the file names as its fallback. In the spot where the picture should be, the browser drew its small broken-image icon. No request went to either host. The result note said so in two sentences: the SVG asks for an outside font, and it links to an image on another site.
Pictures stored inside the SVG itself do work: one with a PNG embedded as a data URI converted correctly, and a gradient with a blur filter rendered too, checked by pixel readings at both ends and the middle. To get exact lettering, turn text into outlines (paths) in your drawing program before you export the SVG.
SVGs with no size, or a size in millimetres
Some SVGs have a viewBox but no width and height. We tested one with a viewBox of 100 by 50 and asked for a width of 300 pixels: the PNG came out 300 by 150. An SVG with neither size nor viewBox has no natural size, so the browser default of 300 by 150 is used, and the result note says so before any scaling.
Units are converted at 96 pixels to the inch, the same as in a web page. A file sized 50 mm by 25 mm came out 189 by 94 pixels. If you need another size, use the pixels option.
Limits and what we did not test
You can add 50 files per run, each up to 20 MB, and the 51st gets "Only 50 files at a time." A PNG can be up to 16,384 pixels on a side and 50 million pixels in total. In practice the pixel total bites first: our 7,000 by 7,000 run worked (49 million pixels, 1,102,995 bytes), while 9,000 by 6,000 and a 16,384 pixel wide version of the 400 by 240 sample were refused with "The new size is larger than the browser can draw, use a smaller one." Fifty copies of the sample at 2x took about 1.4 seconds in our test browser.
We did not test SVG files from large design tools or icon libraries, files near the 20 MB limit, or any browser other than Chromium. Other browsers draw SVG with their own engines, so fine details such as text spacing can differ a little. Check a PNG you plan to print.
When this is the right tool
Use it to get an SVG into a program, site or form that only takes PNG, or to flatten a logo onto a colour. Turning a PNG back into a clean SVG is a different task, and this page does not do it. If the PNG comes out larger than you want, run it through the image compressor. More conversions are listed on the converters hub.
Measured results
| SVG | Setting | PNG pixels | PNG bytes |
|---|---|---|---|
| shapes.svg, 473 bytes | Scale 1 | 400 by 240 | 10,686 |
| shapes.svg | Scale 2 | 800 by 480 | 26,407 |
| shapes.svg | Scale 3 (or 1200 px wide) | 1200 by 720 | 46,272 |
| shapes.svg | Scale 5 | 2000 by 1200 | 94,259 |
| shapes.svg | Scale 10 | 4000 by 2400 | 279,852 |
| shapes.svg | Height 600 only | 1000 by 600 | 35,902 |
| shapes.svg | 500 by 500 box, proportions kept | 500 by 300 | 14,572 |
| shapes.svg | 500 by 500, proportions off | 500 by 500 | 17,700 |
| shapes.svg | Scale 1, white background | 400 by 240 | 10,643 |
| shapes.svg | Scale 1, yellow background | 400 by 240 | 10,821 |
| Gradient and blur SVG, 384 bytes | Scale 2 | 600 by 400 | 275,482 |
| shapes.svg | 7,000 by 7,000, proportions off | 7000 by 7000 | 1,102,995 |
When a drawing program is better
If you edit the SVG anyway, Inkscape or Illustrator can export a PNG of a chosen area, set a resolution in DPI, and outline the text. This page makes a PNG of the whole drawing with no DPI value.
For picture work after the export, GramFile has a download page for XnView MP.
Frequently asked questions
Is my SVG uploaded?
No. Your browser draws the file and builds the PNG on your device. In our network log with two SVGs, the page made 12 requests, none with a body, and the only outside hosts were Google's ad and analytics services.
How do I get a transparent PNG from an SVG?
Leave the background on Transparent, which is the default. The corner pixel of our test PNG read back as fully transparent.
Why is my PNG blurry?
It has too few pixels for where you use it. Convert again at a bigger scale, for example 2x or 3x, or type the exact width you need. The SVG itself does not lose sharpness.
How do I convert SVG to PNG at a specific size?
Set Size by to Pixels and enter a width, a height or both. With one value the other follows the drawing's proportions. Both values with proportions on fit the drawing inside that box.
Why does the text look different from my design?
The font is not available to the browser, often because the SVG loads it from another website. Text then uses a fallback font. Turn text into outlines before you export the SVG.
Why is a linked picture missing?
Images that an SVG links from other sites are not loaded here. Embed the picture in the SVG as a data URI, or use a file that does not rely on outside links.
Does the PNG store a DPI value?
No. We found no resolution data in the PNGs. The size in pixels is what counts, so choose it for your use.
How many files can I convert at once?
Up to 50 per run, each up to 20 MB. Use Download all as ZIP to take them together.