Skip to main content

How to Choose the Size When Converting SVG to PNG

3 min read

Converting an SVG to PNG raises one question right away: how many pixels wide should the PNG be? An SVG is stored as shapes and curves, not pixels, so it has no original size to fall back on. This page covers how to pick one.

Why you have to choose a size

A PNG has a fixed width and height in pixels. Once the SVG becomes a PNG, the resolution is locked in, and enlarging the PNG later blurs it like any other bitmap. Convert a little larger than the size you plan to use. Shrinking a PNG afterward is fine; enlarging it is not.

Setting the size on this site

This site draws the SVG as a vector at the size you set and saves that result. It does not render a small PNG and stretch it, so a large size stays sharp.

To see the difference, the same SVG logo was saved as PNGs 64, 256 and 1024 px wide with this site's converter, and all three were then displayed at the same width (320 px).

The same SVG logo saved as 64, 256 and 1024 px PNGs and compared at 320 px wide. The enlarged 64 px file is blurry and the STAR LEAGUE text below the logo is unreadable; the 256 px and 1024 px files are sharp

The 64 px file (3.0KB) blurs at the edges when enlarged, and its text can't be read. The 256 px (14.2KB) and 1024 px (81.5KB) files both looked sharp. File size grows with the dimensions, so a size slightly above what you need is enough.

There are four ways to set the size:

  • Width (px): set the width and the height follows the aspect ratio. This is the simplest option.
  • Height (px) or Scale (%)
  • Exact size (width × height): for cases that need precise dimensions, such as a square icon. If the SVG's proportions differ, "Keep ratio + fill the margins" centers it and leaves the rest transparent. A wide SVG placed in a 256×256 PNG is one example.

When the SVG has no size information

If the SVG has no width and height, it is drawn 1024px wide, with the height taken from the viewBox ratio. With no viewBox either, it is treated as a square. If the automatic size isn't what you want, set one with the options above. An icon SVG declared as small as 24×24 can still become a large, sharp PNG once you give it a size.

Transparent background

The result has a transparent background by default. If you need a white one, save as JPG and pick a background color, or stay with PNG, turn on "Fill transparent areas and margins with the background color" and choose a color.

Common problems

  • The text shows up in a different font. If the SVG uses a font that isn't installed on the system, the browser substitutes another one. Convert the text to outlines (paths) before saving the SVG and this can't happen. Most vector editors have a "convert to outlines" command.
  • Linked images or fonts are missing. An SVG that loads external files may fail to fetch them while it is being drawn as an image. Embed what the SVG needs before you save it.
  • A complex SVG is slow. Drawing a very complex SVG at a very large size can take a long time or fail. The limit is 16384px on a side, but set only what you need.

Starting sizes by use

There is no single right answer, so treat these as first guesses.

  • Web logo: about twice the width it is displayed at, for high-density screens
  • App or game icon: whatever the platform's documentation requires (512×512 or 1024×1024, for example)
  • Favicon: a square of 256×256 or less; see the favicon guide. To build a full set of icon sizes from one SVG, use the favicon and app icon generator

To convert an SVG to PNG or JPG, drop it into the converter on the home page and choose the output format and size.

If you want to go the other way and turn a PNG or similar image into an SVG, read Converting PNG to SVG: What Works and What Doesn't first. That conversion is an estimate, and it has limits.

More guides