Favicon Generator
Turn one image into the complete modern favicon set — ICO, SVG, Apple touch and PWA icons, manifest and HTML — entirely on this device.
Drop an image here — it is read on this device, never uploaded.
No drag and drop needed — the button opens this device's file picker.
PNG, JPEG, SVG, WebP or GIF · up to 20 MB
You can also paste an image from the clipboard anywhere on this page — screenshots work.
On phones clipboard paste is limited — the picker button does the same job.
- 16 px (ICO)—
- 32 px (ICO)—
- 48 px (ICO)—
- 180 px (Apple touch)—
- 192 px (PWA)—
- 512 px (PWA)—
- 512 px (maskable)—
Drop, pick or paste an image — previews of the finished icons appear here.
Press ? for shortcuts
Do it offline:$ magick logo.png -define icon:auto-resize=48,32,16 favicon.ico
How to use it
- Drop an image on the page, pick one with the button, or paste a copied image straight from the clipboard — a screenshot works. PNG, JPEG, SVG, WebP and GIF all decode here.
- Adjust the options column: background color for the opaque outputs, padding, preview corner radius and the maskable safe-zone inset. The defaults suit most logos unchanged.
- If the source is not square it renders padded first — then pick pad, centered on your chosen background, or center-crop; both candidates preview live and switching re-renders.
- Press Download zip (or ⌘/Ctrl + S) and copy the files from favicon-set.zip — eight with an SVG source, seven otherwise — into the root of your site.
- Copy the HTML head block (⌘/Ctrl + C) and paste it inside <head> on every page — the README repeats the same lines.
Drop one square image — PNG, JPEG, SVG, WebP or GIF — and download the complete modern icon set: favicon.ico holding 16, 32 and 48 px PNGs, a sanitized favicon.svg when the source is an SVG, the 180 px Apple touch icon, PWA icons with a maskable variant, site.webmanifest and the matching HTML head block, zipped. Rendering happens on this device; keep the DevTools Network panel open while it runs and watch no bytes leave.
How it works
A .ico file is a directory, not an image format of its own: six header bytes declare an icon file and a count, each image gets a sixteen-byte entry — pixel size, bit depth, payload length, byte offset — and the payloads follow untouched. Windows has accepted complete PNG files as those payloads since Vista, so this page writes its three sizes as compressed PNGs rather than legacy uncompressed bitmaps, and a flat-art favicon.ico can land at a few hundred bytes. Example 3 prints the directory of a real file.
Thirty-file icon packs date from years of per-device PNG lines, and almost none of those files is ever requested. Current resolution is short: legacy lookups and pinned tabs hit /favicon.ico, modern engines prefer an SVG declared with type="image/svg+xml", iOS reads apple-touch-icon.png at 180 px, and installed web apps pull artwork from the manifest's 192 and 512 px entries. At most eight files answer every requester there is, and the head block needs at most four link lines.
Android launchers render installed icons inside a platform shape — circle, squircle, teardrop — by cutting that shape out of the 512 px maskable image. The Web App Manifest specification defines what survives any cut: a safe zone forming a centered circle whose radius is 40 percent of the icon's size. The maskable option scales your mark toward that circle over your background color — square corners can still cross it at the default inset — and the manifest tags the file "purpose": "maskable" so launchers know cropping it is intended. Circle and squircle previews show the cut before you ship it.
An SVG source is sanitized before it becomes favicon.svg: a strict allowlist keeps drawing constructs — shapes, paths, text, gradients, filters, clips — and removes scripts, event-handler attributes, foreignObject and every reference to an external URL, naming each removal. The cleaned markup is what the preview and the zip both contain. Since the shipped icon stays a real SVG, a style rule inside the file can respond to prefers-color-scheme for dark-aware tabs — a property of the format; this page ships your sanitized source unchanged and leaves that edit to you.
Examples
Head block for a set that includes favicon.svg<link rel="icon" href="/favicon.ico" sizes="48x48">
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
<link rel="manifest" href="/site.webmanifest">
The four link lines browsers actually request, byte-for-byte as the copy button emits them. The SVG line appears only when the source was an SVG — raster-only sets print three — and the ICO line carries sizes="48x48" so engines can rank the container against the vector.
site.webmanifest for the PWA icons{
"icons": [
{
"src": "/icon-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/icon-512.png",
"sizes": "512x512",
"type": "image/png"
},
{
"src": "/icon-maskable-512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
}
]
}
The manifest verbatim — run it through JSON.parse and you get three icon entries: 192, 512 and the maskable 512, the last tagged "purpose": "maskable" per the W3C spec. Name, colors and display mode are yours to add.
16 + 32 + 48 px PNGs (fixtures)ICONDIR: reserved 0 · type 1 (icon) · 3 images
16×16 px · 32-bit · 82-byte PNG at offset 54
32×32 px · 32-bit · 100-byte PNG at offset 136
48×48 px · 32-bit · 153-byte PNG at offset 236The directory of a real 389-byte ICO assembled from the three golden-pack fixture PNGs, read back by an independent parser: six ICONDIR bytes, three sixteen-byte entries ascending, then the untouched payloads at the printed offsets — the first sits at 54 = 6 + 3 × 16.
4×2 px swatch: five #0ea5e9, two white, one transparent#0ea5e9The background suggestion: sampled pixels below alpha 200 never vote, the rest cluster in OKLab, and the densest bucket's average returns as hex — five sky-blue pixels outvote two white ones and the transparent corner abstains. One click applies it as the Apple touch background, undoably.
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" onload="alert(1)"><script>fetch('https://evil.example')</script><circle cx="12" cy="12" r="10" fill="#0ea5e9"/><a href="javascript:alert(1)"><rect width="24" height="24"/></a></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10" fill="#0ea5e9"/></svg>
Removed onload attribute from <svg>.
Removed <script> element and its content.
Removed <a> element and its content.The edge case — a hostile source: an onload handler on the root, a script element phoning another host, a javascript: link wrapping a rect. The output is the survivor plus the strip report; the <a> subtree went with its wrapper because unknown containers are removed whole, never unwrapped.
Every example on this page is executed against the same engine that powers the tool, on every build.
Gotchas worth knowing
Animated sources keep only their first frame
GIF, APNG and animated WebP are recognized from container structure — descriptor counts, the acTL chunk, the VP8X animation bit — and the chip Animated GIF — only the first frame becomes an icon. says what happens next: every size renders from frame one, and the remaining frames never reach a canvas.
Transparent logos get a suggested background
The Apple touch icon must be opaque — iOS backs transparent ones with black — so sources with alpha need a fill. The dominant opaque color, clustered in OKLab from a strided sample, is offered as a one-click swatch; applying it is undoable, and a fully transparent image simply yields no suggestion.
Pad or crop decides what a non-square source becomes
A 1200×630 banner cannot turn square without a decision. Padding centers everything on your background color and keeps every pixel; center-cropping fills the frame and trims the long axis. Both render as live previews with the first generated set, and the choice persists across re-runs.
Wide-gamut sources flatten to sRGB
A Display P3 screenshot or profiled photo draws onto an sRGB canvas here, and the chip Embedded color profile detected — canvas output is flattened to sRGB. fires when PNG iCCP/cICP chunks or a JPEG ICC segment is present. Saturated primaries may shift a touch — rarely visible at icon sizes.
CMYK JPEGs decode like any other JPEG
Print-workflow JPEGs hand their color conversion to the browser's decoder, which delivers RGB pixels to the canvas — the rendered icons match what the same browser shows in a tab.
EXIF orientation is honored
Phone cameras often record rotation as metadata instead of rotating pixels. Decoding passes imageOrientation: "from-image" to createImageBitmap, which applies stored orientation before the first draw — an upright subject stays upright at every size.
Huge sources downscale in halving steps
A 6,000 px artwork never shrinks to 16 px in one draw: each target halves the bitmap until it is within twice the goal, then draws the final size, preserving edges a single pass smears. Past 10,000 px on a side the source is refused up front, the banner printing the limit and the CLI line.
Small sources cannot gain detail
Sizes above the source are interpolation: a 100×100 logo makes crisp 16–48 px icons but a soft 180 px Apple touch tile and softer 512 px PWA art. A notice names your exact pixel size when this applies; an SVG or 512 px raster source avoids it entirely.
The file's bytes decide its format, not its name
Detection reads magic bytes — the PNG signature, RIFF/WEBP, GIF87a/89a, the JPEG start marker — so a .png that is really a JPEG decodes as a JPEG, and a renamed PDF is refused with its first bytes printed in hex. The MIME types reference in the related tools maps signatures to types when a mystery file needs identifying first.
Common errors
Couldn't decode this file — expected PNG, JPEG, SVG, WebP, or GIF. First bytes: 25 50 44 46 2D 31 2E 37- The leading bytes match none of the five supported signatures — these spell %PDF-1.7, a PDF renamed or exported wrong. The hex shows what the file really is; export the artwork as PNG or SVG from its source application and drop that instead.
SVG markup is malformed — closing tag </svg> at character 35 does not match the open <rect> element from character 6.- The SVG failed XML nesting before sanitation began: a <rect> was still open when </svg> arrived, and the message counts to both positions. Nothing is auto-repaired — an icon that half-parses would ship broken — so close the element (or self-close it with />) and re-drop the file.
Removed <script> element and its content.- Not an error — one line of the sanitizer's report. Scripts, event handlers and external references have no business inside an icon, so each removal is named while the drawing survives. At most twenty removals are itemized before an honest summary line takes over.
`#0ea5e` is not a valid color — expected hex (3/4/6/8 digits), rgb(), hsl(), oklch(), or a CSS color name.- The background field accepts hex at 3, 4, 6 or 8 digits plus the listed functional forms; five digits matches none of them — usually a truncated paste. Fix the value or use the native picker beside the field, which only ever emits valid colors.
This file is larger than the 20 MB limit for this tool. For big images use the CLI: magick logo.png -define icon:auto-resize=48,32,16 favicon.ico- Files above 20 MB are refused before any decode starts — an image that heavy is nearly always a photograph carrying far more pixels than icons use. Export a smaller copy, or run the printed ImageMagick line, which resizes any source locally.
This image is larger than the 10,000 px per-side limit for this tool. Resize it first, or use the CLI: magick logo.png -define icon:auto-resize=48,32,16 favicon.ico- Decode metadata reported a side past 10,000 px — more than a browser tab should rasterize. Halving such a source once in any editor brings it inside the cap with no visible cost at icon sizes.
FAQ
What favicon sizes do I need in 2026?
One favicon.ico containing 16, 32 and 48 px, one SVG for engines that scale vectors, one 180 px apple-touch-icon.png, and 192 plus 512 px PWA icons with a maskable 512 declared in site.webmanifest. That is the whole set this page emits — eight files, four head lines (seven and three for raster sources) — and every current requester finds its answer in it.
Does my image upload anywhere while icons generate?
No — decoding, resizing, ICO assembly and zipping execute in your browser on this device. The claim is checkable rather than taken on trust: generate a set with the DevTools Network panel open and the request log stays empty from drop to download.
Why does favicon.ico contain PNGs instead of bitmaps?
The ICO container accepts either legacy uncompressed bitmap data or complete PNG files, and Windows has rendered the PNG form since Vista. PNGs compress, so three sizes fit in a few hundred bytes rather than tens of kilobytes — example 3 prints the directory of a real one.
What is a maskable icon and why is one in the zip?
An icon tagged "purpose": "maskable" promises its artwork survives being cut into any launcher shape, because everything important sits inside the spec's safe zone — a centered circle with 40 percent radius. icon-maskable-512.png is your mark padded into that zone; omit it and Android shrinks your icon onto a plain white plate.
Do I still need an Apple touch icon?
Yes, for anyone saving your site to an iOS home screen: Safari requests apple-touch-icon.png and renders a washed-out page snapshot without it. 180 px covers every device, and the file must be opaque — hence the required background color for transparent sources.
Why was my SVG modified before it shipped?
favicon.svg is the sanitized form of your source: an allowlist keeps drawing elements and safe presentation attributes while removing scripts, event handlers, foreignObject, external hrefs and style rules that reach other URLs — each removal listed by name. A hand-drawn logo usually passes through with nothing stripped at all.
Where do the generated files go on my server?
Into the site root, beside the homepage, so /favicon.ico and the manifest resolve at the paths the head block declares; then paste the printed link lines into <head> on every page. README.txt inside the zip restates both steps with the exact markup.
Keyboard shortcuts
- ⌘/Ctrl + Enter
- Re-run generation with the current source and options — handy after nudging an option.
- ⌘/Ctrl + S
- Download favicon-set.zip. On this page the shortcut saves the icon set, not the page itself.
- ⌘/Ctrl + C
- Copy the HTML head block while focus is in the tool and no text is selected; an actual selection copies only itself.
- ⌘/Ctrl + Shift + C
- Copy the head block even while a selection exists.
- t
- Cycle the color theme (ignored while typing in the background field).
- ? or ⌘/Ctrl + /
- Open the keyboard shortcut overlay.
- Esc
- Close the topmost dialog — the loaded source and every option stay put.