Skip to content
UniKit

ICO icon generator

Packs RGBA pixels into a real Windows ICO container (PNG payload, the Vista-and-later format): the size list can be 16,32,48,256, downscaling uses an area average and upscaling nearest neighbour, and you get per-size byte counts plus a data URL.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

RGBA pixel JSON

The JSON looks like {"width":W,"height":H,"pixels":[r,g,b,a, …]} where pixels must be W×H×4 long. You can also pick an image file: the page reads it through a canvas into the same JSON (images above 256px are scaled down to fit first).

Separate sizes with commas, spaces or pipes. Values run from 1 to 256, at most 16 entries; duplicates are removed and the list is sorted ascending.

Area averaging blends neighbouring pixels by coverage, which looks smoother when shrinking; nearest neighbour keeps hard edges for pixel art. Upscaling always uses nearest neighbour.

Generated ICO

The container follows MS-Windows ICONDIR: a 6-byte header plus a 16-byte directory entry per image, with PNG payloads (native since Windows Vista). A width or height of 0 in the directory means 256px.

Paste RGBA JSON or choose an image to generate an ICO

Icons: 0 · ICO size: — · Largest size: —

What this tool does

  • Build a favicon.ico for a site: pick an image (or paste RGBA pixel JSON) and pack 16/32/48/256 in one file so Windows can choose the right size per context.
  • Make pixel-art icons: turn area averaging off and use nearest neighbour so shrinking keeps hard edges instead of blurring them.
  • Inspect the ICO structure: the per-size PNG byte counts and offsets in the output can be checked directly, and the data URL can be previewed in the front end or inlined into HTML.

Example

Input

{"width":1,"height":1,"pixels":[0,0,0,255]}

Output

icon-16.png: 16 × 16, 80 bytes @ 70
icon-32.png: 32 × 32, 101 bytes @ 150
icon-48.png: 48 × 48, 122 bytes @ 251
icon-256.png: 256 × 256, 661 bytes @ 373
ico: 1034 bytes, 4 images
data-url: data:image/x-icon;base64,AAABAAQAEBAAAAEAIABQAAAARgAAACAg…

A single black pixel is upscaled into four sizes: the 6-byte header plus 4 × 16-byte directory entries equals 70 bytes, which is exactly where the first PNG starts. The data-url line shows only the first 32 base64 characters.

Frequently asked questions

What format are the images inside the ICO?

The payload is PNG (8-bit truecolour with alpha), the standard layout supported since Windows Vista. The width and height fields of a directory entry are one byte each, and 256px is written as 0 per the specification. The container is a 6-byte header (reserved=0, type=1, count) followed by one 16-byte directory entry per image and the PNG payloads in order.

How is downscaling handled?

By default shrinking uses an area average, weighting each source pixel by its coverage, which looks smoother. Turn it off to always use nearest neighbour for pixel art or icons that need crisp edges. Upscaling (when the target size exceeds the source's longest side) always uses nearest neighbour to avoid interpolation blur.

What are the limits on the input image?

The pixels array must be exactly width × height × 4 long and the image may not exceed four million pixels (about 2000 × 2000). When you pick a file, the page first scales anything with a longest side above 256px down to 256 through a canvas, so huge images will not stall the page.

How should the size list be written?

Separate values with commas, spaces or pipes. Sizes run from 1 to 256 with at most 16 entries; duplicates are removed and the list is sorted ascending, so 16,32,48|16 becomes 16/32/48.

Is the image uploaded?

No. Reading pixels from a chosen file (canvas), scaling, PNG encoding and ICO assembly all happen in the browser with no network request; the downloaded .ico is triggered from a locally generated data URL.

Keywords:ico generatorfavicon generator

Related tools