# SVG to PNG Converter

> Drop or paste an SVG and get a sharp PNG at the exact size you choose, with a transparent or coloured background, or a whole set of sizes in one ZIP.

- Page: https://codethatmoves.com/tools/graphics/svg-to-png/
- Site: Code That Moves
- Category: Icons and graphics
- Free, runs in the browser, nothing is uploaded (files you drop in stay on your device)
- Last checked: 2026-11-03

## What it does

- Converts an SVG file or pasted SVG code to PNG, JPEG or WebP
- Set the width or the height in px, scale the natural size 1 to 4 times, or enter a print size in mm, cm or inches at any DPI
- SVGs set in mm or inches (Inkscape, Illustrator) can be exported at their own size at 300 dpi in one click
- The vector is drawn at the target size, so the result is sharp, not an enlarged bitmap
- Exports a 1x, 2x and 3x set or the common icon sizes from 16 to 1024 px as one ZIP
- Copies the PNG straight to the clipboard, ready to paste into a chat or a design tool
- Transparent or coloured background, with a checkerboard preview
- Warns about linked files, CSS imports, scripts and fonts that do not carry over

## How to use it

1. Drop an .svg file, paste the SVG code, or try the sample.
2. Pick a width from the presets, type a width or height, scale the natural size, or enter a print size and DPI.
3. Choose PNG, JPEG or WebP and a background, check the preview, then download, copy, or export a set as a ZIP.

## What it checks and why

An SVG describes a picture with shapes, so it has no fixed pixel size. To get a PNG you choose one. This tool draws the SVG at exactly that size in a canvas, so a 2048 px icon is as sharp as a 16 px one. Scaling a small PNG up instead would blur it.

The size comes from the width and height of the SVG, or from its viewBox when those are missing. If there is neither, browsers use 300 by 150, and the tool says so. Setting the width keeps the ratio, and the height follows.

A browser draws an SVG as an image with some limits. Linked files, whether on the web or next to the SVG, are not loaded, CSS @import rules are skipped, scripts do not run, and text uses fonts installed on the device. The notes under the code list the ones your SVG hits, so the PNG holds no surprises.

For print, pixels follow from the size and the resolution: pixels = inches × DPI. An 85 mm wide logo at 300 dpi needs 1004 px. SVGs exported from Inkscape or Illustrator often carry their size in mm; the tool reads it and offers that size at the DPI you set.

## Reference data

| Preset widths (px) |
| --- |
| 16 |
| 32 |
| 64 |
| 128 |
| 256 |
| 512 |
| 1024 |
| 2048 |
| 4096 |

## Specs and sources

- [MDN: SVG](https://developer.mozilla.org/en-US/docs/Web/SVG)
- [MDN: viewBox](https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Attribute/viewBox)
- [W3C: Scalable Vector Graphics (SVG) 1.1](https://www.w3.org/TR/SVG11/)

## Limits

- The longest side is limited to 8192 px, and the whole image to about 16.7 million pixels, because iPhone and iPad browsers refuse larger canvases. The tool says when it reduces the size.
- Linked images, CSS imports and web fonts are not loaded when an SVG is drawn as an image. Embed them as data: URIs first.
- Copying the image to the clipboard works for PNG only, in browsers that support copying images.
- JPEG has no transparency, so it always gets a background colour.

## Questions

### How do I convert an SVG to PNG?

Drop the file or paste the code, choose the width you need and download the PNG. The vector is drawn at that size in your browser.

### Why is the PNG blurry when I enlarge it elsewhere?

A PNG has a fixed number of pixels. Make it at the largest size you will need, or at 2 times or 3 times for sharp screens, and scale it down from there.

### Does the PNG keep a transparent background?

Yes. PNG and WebP keep transparency. JPEG cannot, so it is filled with the background colour you pick.

### Why are my fonts different in the PNG?

An SVG drawn as an image can only use fonts installed on the device. Convert the text to outlines in your editor to get the exact letter shapes.

### How many pixels do I need to print an SVG at 300 DPI?

Multiply the printed width in inches by 300. For millimetres, divide by 25.4 first: 85 mm ÷ 25.4 × 300 = 1004 px. Enter the print size and DPI in the tool and it sets the width for you.

### Can I export @2x and @3x PNGs at once?

Yes. Under the result, pick 1× 2× 3× or Icon sizes and download the set as one ZIP, named logo.png, logo@2x.png and logo@3x.png.
