induwara.lk
induwara.lkImage · Privacy-first

Favicon Generator

Drop in one image and download the full modern favicon set — favicon.ico, six PNG sizes, a Web App Manifest, and the HTML snippet for your <head>. Runs entirely in your browser. No signup, no upload, sources cited.

By Induwara AshinsanaUpdated May 11, 2026
Favicon GeneratorIn-browser · no upload
Files stay on your device

Everything happens in your browser. Nothing is uploaded.

Fit mode

Scales the source down to fit inside the square; transparent pixels fill the unused area. Best for logos and asymmetric marks.

16 × 16
Browser tab (legacy)
32 × 32
Browser tab (hi-DPI)
48 × 48
Windows site icon
180 × 180
iOS home-screen (Apple touch icon)
192 × 192
Android home-screen (PWA)
512 × 512
PWA splash & maskable icon
Add a source image to start

Pick an image above. A square image at 512 × 512 or larger gives the best 192/512 PWA icons.

ICO bundle built per Microsoft “Icons in Win32” (ICONDIR / ICONDIRENTRY, PNG-payload variant). Manifest follows the W3C Web App Manifest. Sources verified 2026-05-11— full list in the “Sources & references” section below.

How it works

A favicon today is not a single file — it is a small bundle. Every modern site ships one favicon.ico at the root (for legacy paths), a handful of PNGs at carefully chosen sizes (for tabs, iOS, Android, and Windows), plus a Web App Manifest that ties the PNGs to a name, theme colour, and display mode for installable PWAs. The MDN favicon reference and the W3C Web App Manifest together define the minimum modern set; this tool produces every file in that set from a single source image.

For each size the tool does three deterministic steps:

  1. Solve placement. A pure function in lib/data/favicon-generator.ts (computeSquareFit) takes the source dimensions and the chosen fit-mode (fit / cover / stretch) and returns the draw rectangle on the square target canvas. The math is cross-checked a second way (computeSquareFitByRatio) — aspect-ratio comparison instead of scale-factor min/max — and the two must agree to the pixel.
  2. Render to PNG. A canvas of the target size is filled with clearRect, the source is drawn through drawImage(src, offsetX, offsetY, drawWidth, drawHeight), and canvas.toBlob("image/png") returns the encoded byte stream. Transparency is preserved — the output PNG carries alpha.
  3. Bundle into ICO + ZIP. The 3 smaller PNGs (16, 32, 48) are assembled into a single multi-resolution favicon.ico per Microsoft's ICONDIR / ICONDIRENTRY layout, with PNG payloads (the variant supported since Windows Vista). All output files — PNGs, ICO, manifest.json, HTML snippet — are then deflated into a ZIP via fflate's zipSync and offered as a download through an object URL. No bytes leave the browser tab.

The output layout is flat — drop the files into your web root and paste the snippet into <head>. The HTML order matters: the legacy /favicon.ico declaration comes first so browsers that fail to read the more specific type="image/png" tags still find an icon, then the 16/32 PNGs, then the apple-touch-icon, and finally the manifest plus theme-color meta.

Worked examples

Square logo 1024×1024 → 16×16

A well-prepared square source scales down cleanly to the smallest favicon. Aspect ratio is 1:1, so fit and cover produce the same result — no padding, no cropping.

  1. Source: 1,024 × 1,024 px (1.000 ratio)
  2. Target: 16 × 16 px (fit mode)
  3. Scale factor: 0.01563
  4. Drawn at: 16.00 × 16.00 px on target
  5. Offset: (0.00, 0.00) px from top-left

Wide screenshot 1920×1080 → 512×512 fit

A 16:9 source on a 1:1 target. Fit-mode scales by width (the bound dimension), leaving 112 px of transparent padding above and below the image inside the 512×512 PWA icon.

  1. Source: 1,920 × 1,080 px (1.778 ratio)
  2. Target: 512 × 512 px (fit mode)
  3. Scale factor: 0.26667
  4. Drawn at: 512.00 × 288.00 px on target
  5. Offset: (0.00, 112.00) px from top-left

Landscape source 1000×500 → 32×32 cover

A 2:1 landscape source on a 1:1 target with cover-mode. The image is scaled so its short side fills the square; 16 px of the image is cropped off the left and right.

  1. Source: 1,000 × 500 px (2.000 ratio)
  2. Target: 32 × 32 px (cover mode)
  3. Scale factor: 0.06400
  4. Drawn at: 64.00 × 32.00 px on target
  5. Offset: (-16.00, 0.00) px from top-left

Frequently asked questions

Sources & references

Output files

FileSizePurpose
favicon-16x16.png16×16Browser tab (legacy)
favicon-32x32.png32×32Browser tab (hi-DPI)
favicon-48x48.png48×48Windows site icon
apple-touch-icon.png180×180iOS home-screen (Apple touch icon)
android-chrome-192x192.png192×192Android home-screen (PWA)
android-chrome-512x512.png512×512PWA splash & maskable icon
favicon.ico16, 32, 48Legacy multi-resolution icon for browsers, RSS readers, and Windows.
site.webmanifestW3C Web App Manifest — name, short_name, theme & background colours, icons, display mode.
install.htmlThe <link> and <meta> tags to paste into your page's <head>.

Related tools

Rate this tool
Be the first to rate

Comments & feedback

Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.

Found a bug, edge case, or want to suggest an improvement?

Email me at [email protected] — most fixes ship within 24 hours.