← All blog posts

Favicon formula explained simply

WhiteUI · A plain-English guide to the Favicon Generator

A favicon has no complicated formula — just three short ones, and the whole job follows from them. Pixels equals size times size. Raw bytes equals pixels times four. And the scaling rule: always shrink from the biggest size, never stretch from the smallest. Try the numbers yourself on the Favicon Generator, which draws a letter favicon at 512 pixels and exports it at every smaller size.

A 512 pixel source shrunk to 16 pixels keeps 1 pixel in every 1,024; a 16 pixel source stretched to 512 is 32 times bigger per side
Downscaling keeps 1 pixel in 1,024. Upscaling a 16 px file 32 times gives a blur, not detail.

Formula 1: pixels = size × size

A favicon is a square, so its pixel count is the side length multiplied by itself. A 16-pixel icon is 16 × 16, which is 256 pixels. A 32-pixel icon is 32 × 32, which is 1,024 pixels. A 48-pixel icon is 2,304, a 180-pixel icon is 32,400, a 192-pixel icon is 36,864, and a 512-pixel icon is 262,144. The count grows with the square of the side, which is why the jump from 16 to 512 is so large: the side is 32 times bigger, so the pixel count is 32 × 32, or 1,024 times bigger. 180 against 192 sounds close, but the 192 file holds 4,464 more pixels.

Formula 2: raw bytes = pixels × 4

Each pixel in a PNG favicon stores four bytes: one each for red, green and blue, and one for transparency. So the raw size of the image data is the pixel count times four. A 16 × 16 icon is 256 × 4, which is 1,024 bytes. A 32 × 32 icon is 4,096 bytes, a 48 × 48 is 9,216, a 180 × 180 is 129,600, a 192 × 192 is 147,456, and a 512 × 512 is 1,048,576 bytes — exactly 1,024 KiB. Real files are smaller, because PNG compression squeezes flat areas of colour very well, and a letter favicon is mostly flat colour.

pixels = size × size
raw bytes = pixels × 4
scale factor = new size ÷ old size

Formula 3: the scale factor

The scale factor between two sizes is the new size divided by the old size, and it tells you what happens to the picture. Going from 512 down to 16, the factor is 16 ÷ 512, or 1 ÷ 32 per side — each side shrinks to one thirty-second of itself, and the pixel count falls by 32 × 32, so only 1 pixel in 1,024 survives. That sounds drastic, but it is safe: throwing away detail you cannot see at 16 pixels costs nothing. Going the other way, from 16 up to 512, the factor is 32 per side, and the browser has to invent 1,023 pixels for every real one. It cannot invent detail, so the letter turns into a soft blob. That is why the rule exists: shrink, never stretch.

Why the letter survives the shrink

A letter favicon works because a letter is a bold, simple shape. At 512 pixels, the letter W is drawn with smooth curves and clean edges. Shrunk to 16 pixels, it is about 11 pixels tall — roughly two-thirds of the square — and still readable, because the shape is simple and the colour contrast is strong. A detailed logo would not survive: thin lines and small text vanish when only 1 pixel in 1,024 remains. If it does not read at 16 pixels, it is not a favicon, whatever it looks like at 512.

Putting the three formulas together

Start with the master file at 512 × 512, which is 262,144 pixels and 1,048,576 raw bytes. Divide by 32 per side to get the 16-pixel tab icon, which is 256 pixels and 1,024 raw bytes. The sizes in between — 32, 48, 180 and 192 — are the same calculation with different scale factors: 32 is 512 ÷ 16, 48 is 512 ÷ 10.67, 180 is 512 ÷ 2.84 and 192 is 512 ÷ 2.67. You never need to remember those factors — the generator does the scaling. What matters is the direction: every export goes down from 512.

Frequently asked questions

What is the favicon formula?

Three short ones: pixels = size × size, raw bytes = pixels × 4, and scale factor = new size ÷ old size. Always scale down from 512, never up from 16.

How many pixels does a 512 × 512 favicon have?

262,144 pixels, and 1,048,576 raw bytes before compression. A 16 × 16 icon has 256 pixels and 1,024 raw bytes.

Why does shrinking a favicon work but stretching it not?

Shrinking from 512 to 16 keeps 1 pixel in 1,024 and throws away detail you cannot see. Stretching from 16 to 512 forces the browser to invent 1,023 pixels for every real one, so the letter blurs.

How tall is a letter inside a 16-pixel favicon?

About 11 pixels, roughly two-thirds of the square. That is why a bold single letter reads clearly and a detailed logo does not.

More guides on the Favicon Generator

Try it yourself

Try the Favicon Generator — free, in your browser.

Open the Favicon Generator