SVG vs PNG: When to Use Each and How to Convert SVG to PNG Properly
SVG and PNG are often used for the same things, such as logos, icons and illustrations, but they work in completely different ways. SVG describes shapes; PNG stores pixels. On websites SVG is usually the better choice, but many places still require PNG. Knowing when to convert, and how to do it without blurry results, saves a lot of re-exporting.
Vector versus raster
SVG (Scalable Vector Graphics) is an XML text format that describes shapes with coordinates and math: “draw a circle with radius 30 at 60,60, filled beige.” The browser draws it fresh at whatever size it’s displayed, so it’s always sharp, from a 16px favicon to a billboard.
PNG (Portable Network Graphics) is a raster format: a fixed grid of pixels, compressed losslessly. It looks perfect at its native size and soft or blocky when enlarged.
| Aspect | SVG | PNG |
|---|---|---|
| Type | Vector (shapes) | Raster (pixels) |
| Scaling | Infinite, always sharp | Blurry when enlarged |
| File size for logos and icons | Usually tiny (1–10 KB) | Grows with dimensions |
| File size for photos | Impractical | Large (use JPEG/WebP instead) |
| Transparency | Yes | Yes |
| Editable as text / styleable with CSS | Yes | No |
| Animation | Yes (CSS, SMIL) | No (APNG is separate) |
| Supported everywhere | No | Almost universally |
Where SVG isn’t accepted
Despite universal browser support, many platforms still won’t take an SVG upload:
- most social networks (profile pictures, posts, cover images),
- app stores and many app icon pipelines,
- Microsoft Office and Google Slides in some contexts (support has improved but varies),
- many email clients,
- marketplaces, ad platforms and some CMS media libraries, often for security reasons, because SVG files can contain scripts.
In all of these cases, you need a PNG (or JPEG) export.
Exporting at the right scale
Because SVG has no fixed resolution, you choose one when you convert. Pick the largest size the PNG will be displayed at, and multiply for high-density screens:
| Final display size | Export at 1x | 2x (most phones/laptops) | 3x (high-end phones) |
|---|---|---|---|
| 48 px icon | 48 | 96 | 144 |
| 200 px logo | 200 | 400 | 600 |
| 1200 px social image | 1200 | 2400 | 3600 |
For print, multiply the size in inches by 300. A 3-inch-wide logo needs a 900px export. Our print resolution guide explains why.
The SVG to PNG converter above offers 1x to 8x scaling or an exact pixel width, and keeps transparency.
How the SVG size is determined
SVGs declare their size in two ways:
widthandheightattributes, likewidth="120" height="120",- a
viewBox, likeviewBox="0 0 120 120", which defines the coordinate system.
If width and height are missing or set to percentages (100%), a converter has no fixed size to start from, so it falls back to the viewBox dimensions. If both are missing, browsers default to 300 × 150. If your export comes out at an unexpected size, check these attributes.
Common conversion problems
Wrong or missing fonts. SVG text references fonts by name. If the font isn’t installed on the computer doing the conversion, a fallback font is used and the text looks different. Fix: convert text to outlines (paths) in your design tool before exporting, or embed the font.
Missing external images or styles. An SVG that references external files (linked images, external CSS) may render without them when converted in isolation. Inline the styles and images first.
Hairline strokes. A 0.5px stroke looks fine on screen but can disappear or render unevenly at 1x. Export at 2x or thicken the stroke.
Transparent versus white background. PNG keeps transparency; JPEG doesn’t. If the image will be placed on colored backgrounds, keep it transparent. If a platform shows transparency as black (some do), add a background color.
File size comparison
For a simple two-color logo, typical sizes might be:
| Version | Size |
|---|---|
| Optimised SVG | 1–3 KB |
| PNG at 400 × 400 | 8–20 KB |
| PNG at 1200 × 1200 | 25–60 KB |
For icons and logos on your own website, SVG wins on size and sharpness. Optimise it first to strip editor metadata; our SVG optimization guide shows how much that saves.
When PNG is actually better
- Complex illustrations with thousands of paths, gradients, filters and blurs can be larger as SVG than as PNG and slow to render. If an SVG is over a few hundred kilobytes, test a PNG or WebP.
- Screenshots and photos are raster by nature; SVG offers nothing.
- Anything uploaded by users, where accepting SVG creates security risks.
A simple decision guide
- Is it a photo? Use JPEG, WebP or AVIF, not SVG or PNG.
- Is it a logo, icon or simple illustration for your own website? Use SVG.
- Is it going to a platform that doesn’t accept SVG? Export PNG at 2x the display size.
- Is it for print? Use the vector file (SVG, PDF or EPS) if the printer accepts it, or a PNG at 300 DPI.