SVG vs PNG for Icons: Which Format Should You Use?

Is SVG or PNG better for icons?
SVG is the better format for most website and app icons. An SVG icon is a tiny text file, often under 1 KB, that stays sharp at any size and changes colour with CSS. PNG is a fixed grid of pixels, so it suits places that cannot read SVG, such as many email apps.
Last month I exported the same home icon twice. One copy was an SVG, the other a PNG. On my laptop's sharp screen, the PNG looked a little soft around the roof. The SVG looked like it was printed. That tiny test is the whole SVG vs PNG story in one picture.
Let me explain why that happens, what the file sizes really look like, and when PNG is still the right call. I ran every number below on the 891 icons in the fmicon library, so you can see real data, not guesses.
What is the difference between SVG and PNG?
SVG is a vector format, and PNG is a raster format. An SVG file stores shapes as maths, like "draw a line from here to there". A PNG file stores a fixed grid of coloured pixels.
SVG stands for Scalable Vector Graphics. The World Wide Web Consortium (W3C) published it as an official web standard in 2001. Because the file describes shapes instead of pixels, the browser can redraw it at 16 px or 600 px with the same clean edges.
PNG stands for Portable Network Graphics. The W3C made it a standard in 1996. PNG is lossless, which means it keeps every pixel exactly. It also supports transparency. That is why it became the default for icons and logos before SVG was widely supported.
Here's the thing. A pixel grid has a fixed size. If you stretch a 24 px PNG to 48 px, the browser has to guess the missing pixels. That guess is what makes edges look blurry.
Which is smaller, SVG or PNG?
For simple icons, SVG is usually smaller, especially once you need sharp copies for high-resolution screens. In my tests, a typical line icon was under 1 KB as SVG, while one 256 px PNG of the same icon was about 6.5 KB.
I measured these files straight from the fmicon build:
| File | Size |
|---|---|
| Home icon, SVG (linear style) | 541 bytes (0.53 KB) |
| Home icon, SVG after gzip compression | 300 bytes (0.29 KB) |
| Home icon, PNG at 24 px | 459 bytes (0.45 KB) |
| Home icon, PNG at 48 px (2x screens) | 910 bytes (0.89 KB) |
| Home icon, PNG at 72 px (3x screens) | 1,400 bytes (1.37 KB) |
| Average linear icon, SVG (891 icons) | 878 bytes (0.86 KB) |
| Average linear icon, PNG at 256 px | 6,510 bytes (6.36 KB) |
This is where it gets interesting. At exactly 24 px, the PNG is slightly smaller than the raw SVG. But nobody ships just one PNG anymore. You need a 2x and often a 3x copy for phones, and those add up fast. One SVG covers every size.
Servers also compress SVG with gzip or Brotli, because SVG is plain text. The home icon shrank from 541 to 300 bytes. PNG is already compressed, so it barely shrinks further.
What about detailed icons?
Detailed artwork closes the gap but does not flip it. The glass icons in fmicon use gradients and soft layers. They average 2.9 KB as SVG and 11 KB as a 256 px PNG. Very complex illustrations with thousands of points can be bigger as SVG, but icons rarely get there.
Why do SVG icons stay sharp on retina screens?
SVG icons stay sharp because the browser draws them fresh for every screen. A PNG has a fixed number of pixels, so on a 2x or 3x display it either gets stretched and blurry or you must ship larger copies.
Apple introduced its Retina display with the iPhone 4 in 2010, at twice the pixel density of earlier models. Today most phones run at 2x or 3x. Developers call this the device pixel ratio. A 24 px icon on a 3x phone actually covers 72 real pixels.
With PNG, that means making icon.png, icon@2x.png and icon@3x.png, then wiring them up with srcset. With SVG, you ship one file and you are done. Honestly, this alone is why I switched every product icon I work on to SVG.
Can you change the colour of an SVG icon?
Yes, you can change the colour of an SVG icon with one line of CSS. If the icon uses currentColor, it takes the text colour of whatever it sits in. A PNG needs a separate file for every colour.
MDN Web Docs describes currentColor as a keyword that uses the element's current color value. Every fmicon line icon is drawn this way. So a button with color: #1265ec gets a blue icon, and its hover state can change the icon too, with no extra files.
<button style="color: #1265ec">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true">
<path d="..." stroke="currentColor" stroke-width="1.5" />
</svg>
Home
</button>
One catch. The colour trick only works when the SVG is inline in the page or rendered by a component, such as fmicon-react. An SVG loaded through an <img> tag keeps its own colours. For full control, paste the SVG code or use a package. The raw SVG and CDN guide shows both ways.
When should you use PNG icons instead?
Use PNG icons where SVG is not supported or not allowed. The big three are email newsletters, social share images, and older apps or tools that only accept pixel images.
- Email. According to Can I Email, which tracks HTML support across email clients, Gmail does not display SVG images. PNG is the safe choice for icons in newsletters.
- Social share cards. The Open Graph image that Facebook, LinkedIn and X show when someone shares your link should be PNG or JPG.
- Slides and documents. Some presentation and document tools still handle PNG better than SVG. When in doubt, a PNG just works.
- App store and marketing assets. Stores and ad platforms ask for pixel images at exact sizes.
Here's the good news. You do not have to pick one forever. fmicon serves every icon in both formats from its CDN: SVG at cdn.fmicon.dev/svg/ and a 256 px PNG at cdn.fmicon.dev/png/. Use the SVG on your site and grab the PNG for the email.
SVG vs PNG: a side-by-side comparison
SVG wins on sharpness, file size at multiple resolutions, and colour control. PNG wins on support in email and older tools. Both are lossless and both support transparency.
| Feature | SVG | PNG |
|---|---|---|
| Type | Vector (shapes) | Raster (pixels) |
| Sharp at any size | Yes | Only at its own size |
| Typical icon size | 0.5 to 1 KB | 0.5 to 7 KB, per copy |
| Change colour with CSS | Yes, with currentColor | No |
| Transparency | Yes | Yes |
| Works in Gmail | No | Yes |
| Editable in Figma | Yes, as shapes | Only as an image |
| Best for | Websites, apps, design files | Email, social cards, older tools |
What this means for your project
For a website or app, make SVG your default and keep PNG as a backup format. That one rule covers almost every case I have seen.
- Use SVG icons in your interface: buttons, menus, tab bars and lists.
- Use a component package if you build with React, Vue or Svelte. It handles size, colour and accessibility for you. Our guide to React icons walks through it.
- Use PNG for email, social cards and anything that will be pasted into another app.
- Give meaningful icons a text label. Our accessible icons guide covers the rules in plain words.
My take after switching a whole icon set
Based on what I've seen building fmicon, SVG is not just the better format, it is the less stressful one. I used to keep folders of PNGs in five sizes and three colours. Now one SVG file does the job of all of them.
The only time I reach for PNG is when something outside my control needs it. That is a nice place to be. You stop managing files and start designing.
Pick SVG first, keep PNG for the edges
In the SVG vs PNG question, SVG wins for icons on the web: it is sharp everywhere, small, and easy to recolour. PNG still earns its place in email, social cards and older tools. If you want both without the busywork, browse the free fmicon icons, copy the SVG, and download the PNG only when you need it.
Frequently Asked Questions
Does Google index SVG images?
Yes, Google indexes SVG images. Google's image SEO documentation lists SVG among the supported formats, next to JPEG, PNG, WebP, GIF, BMP and AVIF. For best results, add a descriptive file name and alt text, and place the image near related text on a page Google can crawl.
Is it safe to use SVG files on a website?
Yes, SVG files are safe when they come from a trusted source. SVG is code, so a file can hold scripts. Browsers do not run scripts in an SVG loaded with an img tag. If users can upload SVG files to your site, clean them with a sanitizer such as DOMPurify first.
How do you convert an SVG icon to PNG?
You can convert an SVG icon to PNG with a design tool such as Figma or Inkscape, or with a command-line renderer like resvg. Export at two or three times the display size for sharp screens. fmicon already hosts a 256 px PNG of every icon on its CDN.
Is WebP better than PNG for icons?
WebP can be smaller than PNG for pixel images. According to Google's WebP documentation, lossless WebP files are about 26% smaller than PNGs. For interface icons, SVG still beats both, because one vector file stays sharp at every size and can change colour with CSS.
Should a logo be SVG or PNG?
A logo should be SVG on your website and PNG for places that need pixels. SVG keeps the logo crisp on every screen and at any size. Keep a PNG copy at around 512 px for email signatures, social profiles and documents that do not accept SVG.
