If you've ever grabbed your company's beautiful, wide typographic logo, shrunk it down to 32x32 pixels, and ended up with an illegible gray smudge in your browser tab—you're not alone. Figuring out exactly how to make favicon from logo files is a frustrating rite of passage for front-end developers. Look at GitHub. Their main brand asset includes the word 'GitHub' sitting right next to the Octocat. But look at your browser tab right now. You only see a crisp, high-contrast Octocat silhouette. If they tried to cram the text in there, it would be completely unreadable.

You cannot just resize your master brand file and call it a day. We need to extract the recognizable mark, ensure it survives dark mode, and generate a modern asset stack. Grab your master logo file (preferably an SVG) and open up Figma, Illustrator, or a free tool like Photopea. We are going to build this properly.

Prerequisites for Favicon Extraction

Before we touch any code, you need the right source material. Do not start with a low-resolution JPEG. You need a vector file (SVG, EPS, or AI) or a very high-resolution PNG with a transparent background. If your designer handed you a flat JPEG with a white background, send it back and ask for the vector. It will save you hours of masking pain.

Step-by-Step: Extracting the Icon

Step 1: Isolate the Logomark

The golden rule of browser tabs is that text fails at 16x16 pixels. Your first job is to delete the text entirely. If your brand is a combination mark (an icon next to text), isolate just the icon. If you want to understand the deep design theory behind this, I wrote a detailed breakdown on the Favicon vs Logo Difference.

But what if your logo is a 'wordmark' (just text, like Google or Stripe)? You have two options. You can extract the first letter and make it bold (like Google's multicolored 'G'), or you can use a stylized version of the first letter (like Stripe's 'S' with a slash). Delete everything else on the canvas.

Step 2: Square the Canvas and Set Padding

Favicons require a strict 1:1 aspect ratio. Create a new 512x512 pixel frame in your design tool. Paste your isolated mark directly into the center. Now, resist the urge to scale the mark so it touches the edges of the canvas.

You need breathing room. If your icon touches the edges, it will look massive and clunky compared to the other tabs in the user's browser. Scale your mark down so it takes up roughly 80% of the canvas, leaving a 10% transparent margin on all sides. This padding is critical when Android devices crop your icon into circles or rounded squares.

Step 3: Optimize for Dark and Light Tabs

Browser tabs in 2026 are chaotic environments. Safari might be translucent gray, Chrome might be pitch black, and Edge might be stark white. If your isolated mark is dark gray text on a transparent background, dark mode users won't see it at all.

You need to ensure high contrast. If your mark is a dark solid color, consider adding a subtle white stroke around it, or placing it on a solid brand-colored background with rounded corners. Export this final, squared, high-contrast frame as an SVG file.

Step 4: Generate the Modern Stack

Now that you have a perfect, simplified SVG, we need to turn it into browser-readable files. I use Mzu favicondl for this because it outputs the exact 2026 stack without the legacy bloat of 15 different Apple Touch sizes.

Upload your SVG to the tool, and it will generate your favicon.ico (for legacy browsers), your apple-touch-icon.png (for iOS), and your web manifest files. Once you download the package, drop the files into your project's public root directory.

Step 5: Add the HTML Code

Finally, link the files in your document head. You don't need twenty lines of code anymore. A modern, robust setup looks exactly like this:

<!-- Modern SVG icon -->
<link rel='icon' href='/favicon.svg' type='image/svg+xml'>
<!-- Fallback for legacy browsers -->
<link rel='icon' href='/favicon.ico' sizes='32x32'>
<!-- Apple Touch Icon for iOS -->
<link rel='apple-touch-icon' href='/apple-touch-icon.png'>
<!-- Android PWA Manifest -->
<link rel='manifest' href='/site.webmanifest'>

Notice we use single quotes and keep the paths absolute to the root. For a deeper dive into why we structure it this way, check out our Website Icon Complete Guide.

Common Pitfalls to Avoid

Extracting a favicon from a master logo isn't just about resizing—it's about simplification. Strip the text, square the canvas, ensure high contrast, and let Mzu favicondl handle the file generation. Your browser tabs will instantly look more professional.