Favicon practice questions with answers
The fastest way to check you understand favicons is to answer a few questions with numbers, so this post is a short practice set: six questions, each with the working shown. Cover the answers and work each one out on paper first. The only formulas you need are three: pixels equals size times size, raw bytes equals pixels times four, and the scale factor is the new size divided by the old size. Try the numbers on the Favicon Generator as you go.
Question 1: pixels and bytes of the master file
A favicon is drawn at 512 × 512 pixels. How many pixels does it hold, and how many raw bytes is that? Pixels are size times size, so 512 × 512 is 262,144 pixels. Raw bytes are pixels times four — one byte each for red, green, blue and transparency — so 262,144 × 4 is 1,048,576 bytes, exactly 1,024 KiB. The tab icon, at 16 × 16, is 256 pixels and 1,024 raw bytes — the master holds 1,024 times as much picture.
Question 2: the retina rule
A tab is 16 pixels wide, but the screen is retina, with twice the pixel density. Which file should the browser use, and what size does it show at? The browser should use the 32 × 32 file, which holds 1,024 pixels, and it shows it in a 16-pixel space on screen — 16 CSS pixels, 32 device pixels. That is the retina rule: provide a file twice the size in each direction, and the screen uses the extra pixels for sharpness instead of stretching the small file. If only the 16-pixel file exists, the retina screen stretches it to fill 32 device pixels, and the letter softens.
pixels = size × size raw bytes = pixels × 4 scale factor = new size ÷ old size
Question 3: 180 against 192
An Apple touch icon is 180 × 180 and an Android icon is 192 × 192. How many more pixels does the Android icon hold? 180 × 180 is 32,400 pixels, and 192 × 192 is 36,864 pixels. The difference is 36,864 − 32,400, which is 4,464 pixels. The two sizes look almost the same, but the count grows with the square of the side. Export both, link both, and let each device take its own size.
Question 4: the ICO fallback
A multi-size ICO file holds 16, 32 and 48 pixels. How many bytes of picture data does it hold, and what is the total file size before compression? The three images hold 256 + 1,024 + 2,304 pixels, which is 3,584 pixels, and at four bytes per pixel that is 14,336 bytes of picture data. The container adds a 6-byte header and a 16-byte directory entry per image, which is 48 bytes, so the total is 14,336 + 54, which is 14,390 bytes — about 14 KB. Small, simple, and enough to cover old desktop browsers.
Question 5: the wide logo
A logo is 800 pixels wide and 200 tall. Squeezed into a 32 × 32 favicon without changing its shape, how tall will it be, and what fraction of the square does it fill? The scale factor is 32 ÷ 800, which is 0.04, so the height becomes 200 × 0.04, which is 8 pixels. The logo fills 8 of 32 pixels of height, which is 25% of the square, leaving the rest empty. Do not squeeze the logo: take one letter from it, draw that at 512 × 512, and use the letter as the favicon.
Question 6: the shrink from 512 to 16
A favicon is shrunk from 512 pixels to 16. What fraction of the pixels survives? The scale factor per side is 16 ÷ 512, which is 1 ÷ 32, so the pixel count falls by 32 × 32, which is 1,024. Only 1 pixel in 1,024 survives the shrink. The detail thrown away is detail you cannot see at 16 pixels anyway. The reverse is not safe — stretching 16 up to 512 forces the browser to invent 1,023 pixels for every real one, and the letter turns into a blur. That is why every favicon is drawn big and shrunk down, never drawn small and stretched up.
Frequently asked questions
How many pixels is a 512 × 512 favicon?
262,144 pixels, and 1,048,576 raw bytes before compression. A 16 × 16 icon has 256 pixels and 1,024 raw bytes.
What size favicon does a retina screen need?
32 × 32 pixels for a 16-pixel tab. The 32-pixel file is shown in a 16-pixel space, using the extra pixels for sharpness.
How many more pixels does 192 have than 180?
4,464 pixels. 192 × 192 is 36,864 and 180 × 180 is 32,400, so always export both files.
How big is an ICO file holding 16, 32 and 48 pixels?
About 14 KB before compression: 14,336 bytes of picture data plus 54 bytes of header and directory entries, 14,390 bytes in total.
More guides on the Favicon Generator
Try the Favicon Generator — free, in your browser.