← All blog posts

How to calculate favicon

WhiteUI · A plain-English guide to the Favicon Generator

A favicon is the small icon a browser shows next to your page title, and working out its sizes is mostly arithmetic: pixels, counts and one rule about which direction to scale. There is no single right size: the icon appears in six places, from a 16-pixel tab to a 512-pixel master file. This guide works through the numbers, so you can size a favicon once and have it look right everywhere. Check every figure as you go with the Favicon Generator.

Six favicon sizes from 16 to 512 pixels: 16 has 256 pixels, 32 has 1,024, 48 has 2,304, 180 has 32,400, 192 has 36,864 and 512 has 262,144
Six sizes cover every place a favicon appears: 16 px for the tab, 32 px for retina tabs, 48 px for the taskbar, 180 px for Apple, 192 px for Android and 512 px as the master file.

The six sizes you need

The set is small and fixed. The browser tab uses 16 × 16 pixels, a high-resolution screen uses a 32 × 32 file for the same 16-pixel tab, and the Windows taskbar uses 48 × 48. Phones need bigger files: Apple touch icons are 180 × 180, Android home-screen icons are 192 × 192, and the master file you draw from is 512 × 512. That is the whole set: 16, 32, 48, 180, 192 and 512. Older guides also list a multi-size ICO file holding 16, 32 and 48 together, which is still the safest way to cover old desktop browsers, but the six PNG sizes above cover every modern case.

How many pixels is that?

Multiply the side by itself. A 16 × 16 icon holds 256 pixels, a 32 × 32 holds 1,024, a 48 × 48 holds 2,304, a 180 × 180 holds 32,400, a 192 × 192 holds 36,864, and a 512 × 512 holds 262,144. The jump is striking: the master file holds 1,024 times as many pixels as the tab icon, because 512 is 32 times 16 per side, and 32 × 32 is 1,024. Detail that looks fine at 512 pixels vanishes at 16, because only 1 pixel in 1,024 survives the shrink.

pixels = size × size
raw bytes = pixels × 4 (red, green, blue, alpha)

What about file size?

An uncompressed image with four bytes per pixel — red, green, blue and transparency — takes 1,024 bytes at 16 × 16, 4,096 at 32 × 32, 9,216 at 48 × 48, 129,600 at 180 × 180, 147,456 at 192 × 192, and 1,048,576 bytes at 512 × 512, which is exactly 1,024 KiB. Real PNG files are far smaller than these raw figures, because PNG compression is very good at flat colour: a plain letter on a solid background compresses to a fraction of the raw size, so a 512-pixel letter favicon is usually a few kilobytes, not a megabyte.

Why one file is never enough

A single 16-pixel file looks fine on a tab but turns into a blur on a phone home screen, because the phone has to stretch 16 pixels across 180 or 192 — more than 11 times per side — and there is no detail to stretch. A single 512-pixel file works the other way: older browsers expect the small sizes and may show a blank space instead. The fix is to export all six sizes from one drawing, link each one in the page head, and let each device pick the size it wants.

A quick check before you publish

Three checks catch the usual slips. First, open the 16-pixel file and look at it: if the letter is readable at that size, it will be readable everywhere. Second, count the files: you should have 16, 32, 48, 180 and 192, plus the 512 master. Third, check the page head has a link tag for each size, with the sizes attribute matching the file. A blank tab means a missing file or a wrong link; a soft icon on a phone means the 180 or 192 file is missing. Add the missing file and the problem goes away.

Frequently asked questions

What sizes does a favicon need?

Six: 16, 32, 48, 180, 192 and 512 pixels. The tab uses 16, retina tabs use 32, the taskbar uses 48, Apple uses 180, Android uses 192, and 512 is the master file.

How many pixels is a 512 × 512 favicon?

262,144 pixels. That is 1,024 times the 256 pixels in a 16 × 16 icon, because 512 is 32 times 16 per side.

How big is a favicon file?

A 512 × 512 image holds 1,048,576 raw bytes, but a real PNG of a flat letter favicon is only a few kilobytes, because PNG compression is very good at flat colour.

Can I use just one favicon file?

No. A 16-pixel file turns to a blur on a phone, and a 512-pixel file is ignored by some older browsers. Export all six sizes from one drawing.

More guides on the Favicon Generator

Try it yourself

Try the Favicon Generator — free, in your browser.

Open the Favicon Generator