SVG vs PNG: Vector or Raster for Logos, Icons and Photos?
SVG vs PNG explained: SVG is a vector format that scales to any size, PNG is a fixed grid of pixels. See when each wins for logos, icons, photos and favicons.
Updated
SVG is a vector format and PNG is a raster format. An SVG describes shapes with coordinates, so it stays perfectly sharp at any size and is usually tiny for simple artwork. A PNG stores a fixed grid of pixels, so it handles any kind of image but blurs when enlarged. Use SVG for logos, icons and illustrations, and PNG for screenshots, detailed images and anywhere SVG is not accepted.
Vector vs raster
A raster image is a grid of colored pixels. A 512 x 512 PNG contains 262,144 pixels and nothing else. Show it at that size and it is exact. Show it at 2048 x 2048 and the software has to invent fifteen new pixels for every original one, which is where blur and jagged edges come from.
A vector image is a set of drawing instructions. An SVG file is text, written in XML, with lines such as "a circle at this position with this radius and this fill". The browser redraws those instructions at whatever size is asked for, so the result is as sharp at 16 pixels as at 16,000.
That difference drives everything else in the comparison.
SVG vs PNG at a glance
| SVG | PNG | |
|---|---|---|
| Type | Vector, XML text | Raster, pixel grid |
| Scaling | Sharp at any size | Sharp only up to its pixel dimensions |
| File size | Depends on shape complexity | Depends on pixel dimensions and detail |
| Transparency | Yes | Yes, full alpha channel |
| Animation | Yes, with CSS or built-in animation | No (APNG extension only) |
| Editable in code | Yes, colors and shapes via CSS and JavaScript | No |
| Photos | Unsuitable | Works, though large |
| Browser support | All browsers | All browsers |
| Accepted by social media, email, app stores | Rarely | Almost always |
When SVG wins
Logos. A logo is used at dozens of sizes, from a browser tab to a conference banner. One SVG covers all of them. A simple logo is often 1 to 5 KB as SVG, smaller than a single PNG export at a moderate size.
Icons. Interface icons are simple shapes that need to be crisp on every screen density. SVG icons also inherit color: set fill="currentColor" and the icon follows the text color, including hover and dark mode states, with no extra files.
Illustrations with flat color. Spot illustrations, diagrams, charts and maps made of shapes are compact as SVG and scale with the layout.
High-density screens. A PNG needs 2x and sometimes 3x versions to look sharp on phones and Retina displays. An SVG needs nothing.
When PNG wins
Photos and photographic detail. An SVG can only describe a photo by tracing it into thousands of shapes, which is larger and worse. Photos belong in JPG, WebP or AVIF. PNG is the option when a photo-like image needs lossless quality or transparency.
Screenshots. A screenshot is pixels by nature. PNG stores it exactly.
Complex artwork. File size in SVG grows with the number of points and effects. A detailed illustration with gradients, shadows and textures can be several megabytes as SVG and slow to render, while a PNG of the same artwork has a fixed cost.
Places that reject SVG. This is the most common practical reason. Typical cases:
- Social media profile pictures and post images.
- Link preview images set with
og:image. - HTML email, where support for SVG across mail clients is poor.
- App store icons and the Apple touch icon for iOS home screens, which must be PNG.
- Many content management systems and upload forms, which block SVG by default.
That last restriction exists for a reason. An SVG file can contain scripts, so an SVG from an untrusted source is closer to a web page than to an image. Only upload and embed SVGs from sources you trust.
Logos: keep both
The working rule is to treat the SVG as the master and PNG as an export.
- Get the vector original from the designer, as SVG, AI, EPS or PDF. If you only have a PNG, ask. Tracing a PNG back to vector is a last resort.
- Use the SVG directly on your website.
- Export PNGs for each place that needs one, at the exact size required or larger.
- Export at twice the display size for anything shown on screens. A logo displayed at 200 pixels wide should be a 400 pixel PNG.
When you need a PNG at a different size and only have a larger PNG, scale it down, never up. The Image Resizer takes PNG, JPG, WebP and GIF files, resizes to exact pixel dimensions with the aspect ratio locked, and exports PNG, JPEG or WebP. It works on raster files. To change the size of an SVG, no tool is needed, since the file scales by itself.
Icons and favicons
Favicons are the clearest case of needing both. Modern browsers can use an SVG favicon, but support is not universal, and several required icons are raster by specification. A complete set still includes:
| File | Size | Used by |
|---|---|---|
favicon.ico | 16, 32 and 48 px | Browser tabs, bookmarks, legacy browsers |
favicon-32x32.png | 32 px | Browser tabs on high-density screens |
apple-touch-icon.png | 180 px | iOS home screen |
android-chrome-192x192.png | 192 px | Android home screen |
android-chrome-512x512.png | 512 px | Android splash screen, PWA install |
The Favicon Generator produces exactly that set. Drop in your logo as SVG, PNG, JPG or WebP and it renders every size, with options for a transparent or colored background, square, rounded or circular corners, and padding. The download is a ZIP containing the icons, a site.webmanifest and the HTML snippet for your page head. Starting from the SVG gives the cleanest result, because each size is drawn fresh from the vector shapes.
File size: neither always wins
Simple shapes favor SVG heavily. A two-color icon might be 600 bytes as SVG and several kilobytes as a PNG at a useful size.
Complexity reverses it. As a rough test, open the SVG in a text editor. If it is a few dozen lines, SVG is the right format. If it is thousands of lines of path data, or contains a long block of encoded characters, which means a raster image has been embedded inside it, a PNG or WebP will be smaller and faster.
If you must ship PNGs, the Image Compressor re-packs them losslessly or converts them to WebP for a smaller file.
Converting between them
SVG to PNG is easy and exact. Design tools such as Figma, Illustrator and Inkscape export any size you choose. Export large, then scale copies down in the Image Resizer as needed.
PNG to SVG is not a real conversion. Tracing software estimates shapes from pixels, which is acceptable for a clean black and white logo and poor for anything subtle. The dependable fix is to find the original vector file.
For how PNG compares with other raster formats, see JPEG vs PNG and the overview of image file formats. Related utilities are in the images category.
Try it
Drop your SVG logo into the Favicon Generator and look at the 16 pixel preview. If the mark is unreadable at that size, add padding or use a simplified version, then download the full icon package.