Base64 to Base32 Converter

Paste a Base64 string and get the same bytes, the small numbers a key is stored as, in Base32: capital letters and the digits 2 to 7.

FluffyShield Protected workspace
FluffyShield

Isolated workspace: other page scripts can't read your files. How FluffyShield works

Free · No upload · No sign-up · No usage quotas

Why does an authenticator app want its key in Base32?

Because Base32 has no small letters. A key spelled in it can be typed on a phone or read out loud without a slip of the shift key changing it.

From one alphabet to the other
  1. Decode the Base64 back to its bytes
  2. Write every five bytes as eight characters
  3. Pad a short last group with =

What it does

Longer than the Base64

The test key is 32 characters in Base32 and 28 in Base64. Fewer characters to choose from means each one carries less.

The standard Base32

It writes RFC 4648's alphabet. Other alphabets that share the name, such as Crockford's, aren't produced.

Limits It changes how the key is spelled, never the key itself. The six-digit codes are still worked out by your app.

The key under the QR code

When you turn on two-step sign-in, the site shows a square code for your authenticator app to scan, and usually a line of text underneath for when scanning won't work. That line is the shared secret the app turns into a fresh six-digit code every 30 seconds, and it's written in Base32.

Sometimes the secret reaches you another way: in a backup, an export from another app, or a system's settings page, written in Base64. The app's setup box won't take that. The bytes are fine; the alphabet is wrong.

An alphabet with only one case

Base64 needs 64 characters and gets them by counting small letters and capitals separately. Base32 makes do with 32: the capitals A to Z and the digits 2 to 7. Here is the test key from the standard that authenticator codes follow, 20 bytes, both ways.

Base64, 28 charactersMTIzNDU2Nzg5MDEyMzQ1Njc4OTA=Base32, 32 charactersGEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ

Base64 and Base32

The marked letters are the seven places where the Base64 depends on getting the case right. The Base32 has none. How we checked

In Base64 a small t and a capital T are different characters that stand for different bytes. Type the key with the case of its letters slipped, all small say, and you have another key: the converter reads mtizndu2nzg5mdeymzq1njc4ota= as bytes that differ from the real ones from the very first.

Base32 has nothing to slip. RFC 4648 says as much: the alphabet is meant for places where the case of letters can't be relied on.

Getting the setup key out of Base64

The converter is FluffyBench's Base encoder and decoder set to Base64 in and Base32 out. Everything happens on your device; the key isn't sent anywhere.

  1. Paste the key's Base64 into the Input box.

  2. The setup key is in the Base32 box: beside the input on a computer, under Result on a phone.

    The Base32 box holding GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ, with Copy and Download above it.
    The Base32 box holding GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ, with Copy and Download above it.
  3. Enter it in your authenticator app as the setup key, without any = signs at the end.

The = signs on a shorter key

Base32 works in groups of five bytes. The test key is 20 bytes, four whole groups, so its Base32 ends cleanly. A 16-byte key doesn't fill its last group, and the converter pads it to a multiple of eight characters with six = signs: GEZDGNBVGY3TQOJQGEZDGNBVGY======.

The setup-link description used by Google Authenticator says that padding isn't needed and should be left out, which is why the last step drops it. The letters before the = signs are the whole key.

Your key is written in hex, digits and a to f

Base encoder and decoder

Set From to Base16 and To to Base32 for the same result from hex.

You'd like to see the key's bytes one by one

Base64 to Hex (Base16) Converter

It lists each byte as a pair of digits, which makes two keys easy to compare.

Search FluffyBench