Loading Base64 to Image Converter...

How to Convert Base64 to an ICO Favicon

Favicons often end up as Base64 text: inlined in an HTML head as a data: URI, stored next to a site record in a database, or returned by an API that scrapes icons from other sites. This page turns that text back into a real favicon.ico you can open, inspect or drop into a project.

Step 1

Paste the Base64 favicon

Paste the string into the input panel, for example one copied from a data: URI in an HTML head, a manifest or a JSON response. The data:image/x-icon;base64, prefix and line breaks can stay. You can also upload a .txt file that holds the string.

•
Spot an icon quickly: a Base64 ICO starts with AAABAA and a cursor with AAACAA.
•
Prefix optional: data:image/x-icon;base64, or data:image/vnd.microsoft.icon;base64, in front of the string is stripped for you.
•
About the Sample button: it loads a tiny PNG, not an icon, so the result says PNG. Paste your own favicon string to see an ICO.
Step 2

Check the format and the preview

A moment after you paste, the string is decoded and the Format line shows what the header says the file is: ICO, CUR, or another image type if the string was not an icon after all. The preview shows the size the browser chose to draw.

•
One size on screen: a favicon.ico with 16, 32 and 48 pixel versions shows only one of them in the preview. The download still has all three.
•
Typo in the string: a character that does not belong in Base64 is reported with its line and column. A string cut short while copying is reported too, instead of giving you a broken icon.
•
Not an image at all: if the bytes are text, a PDF or an archive, the page tells you. Base64 to File saves any kind of data.

What is inside an ICO file

A 6-byte header with the type (1 for icons, 2 for cursors) and the number of images, then a 16-byte directory entry for each image giving its width, height and where its data starts. Each image is stored either as a small bitmap with a transparency mask or as a complete PNG, which is common for the 256 pixel size. The ICO file format article covers the details, and Base64 itself is defined in RFC 4648.

Step 3

Download the icon

Click Download to save the decoded bytes. An icon is saved as .ico and a cursor as .cur; anything else keeps the extension of its real format. On larger screens you can type a file name first.

•
As a favicon: put the file in your site root as favicon.ico, or reference it with <link rel="icon" href="/favicon.ico">.
•
Next string: click Clear and paste the next one.
•
Going the other way: Image to Base64 turns an .ico file into a Base64 string, which decodes back to the same file here.

Frequently Asked Questions

How do I know a Base64 string is an ICO file?

Every ICO file opens with the bytes 00 00 01 00, and in Base64 those always come out as AAABAA at the start of the string. A cursor file opens with 00 00 02 00, which shows up as AAACAA. You do not have to check by eye, though: the page reads the decoded header and shows the format it found.

My favicon.ico holds 16, 32 and 48 pixel icons. Are they all kept?

Yes. Decoding Base64 gives back the exact bytes that were encoded, so the downloaded .ico still has every size in it, along with each one’s colour depth and transparency. The preview only shows one picture, because the browser picks a single size to draw (Chrome draws the largest), but the others are still in the file.

Can I decode a cursor (.cur) file here?

Yes. Windows cursors use the same layout as icons plus a hotspot, the point of the arrow that does the clicking. The page labels them CUR and saves them with a .cur extension, unchanged. Chrome usually draws the cursor image in the preview as well.

What happens if I paste a PNG instead of an icon?

It is labelled PNG and downloads as a .png file. This page decodes Base64, it does not convert between image formats, so a PNG does not become an ICO here. Modern browsers accept a PNG favicon through a link tag anyway; if you really need an .ico, an icon editor or ImageMagick can build one from your PNG.

Which data URI prefixes work?

Both names for the icon type are fine: data:image/x-icon;base64, and data:image/vnd.microsoft.icon;base64,. The prefix is removed before decoding, and so are line breaks and spaces. URL-safe Base64 with - and _ is accepted too.

How do I use the decoded file as my site favicon?

Save it as favicon.ico in the root folder of your site. Most browsers request /favicon.ico on their own, and you can also point to it from the page head with a link tag whose rel is icon and whose href is /favicon.ico.

Does my Base64 get uploaded?

No. JavaScript in your own browser decodes the string, draws the preview and builds the download. Nothing is sent to our server and nothing is kept, so the editor is empty again after a reload.

Related pages: Image to Base64 · Base64 to PNG · Base64 to Image