How this calculator works
- Step 1Text to bytesUTF-8Each character becomes one to four bytes.
- Step 2Regroup the bits3 bytes → 4 groupsEvery 24 bits are split into four groups of 6 bits.
- Step 3Look up each group64 charactersEach 6-bit number picks one letter, digit or symbol.
Base64 lets binary data travel through systems that only accept plain text, such as email, JSON and data URLs. It makes data about a third larger.
Worked example: encoding “foo”
The three bytes of “foo” become exactly four Base64 characters: Zm9v.
- Bytes in binary
01100110 01101111 01101111
- 6-bit group 1011001 = 25
- 6-bit group 2100110 = 38
- 6-bit group 3111101 = 61
- 6-bit group 4101111 = 47
- Look up 25, 38, 61, 47 in the alphabetZ, m, 9, v
- Base64Zm9v
When the input is not a multiple of 3 bytes, the last group is filled with zero bits and “=” signs pad the result to a multiple of 4 characters.
Reading the result
- StandardSGVsbG8sIOKCuSB3b3JsZA==Uses + and /, with = padding. For email, data URLs and most APIs.
- URL-safeSGVsbG8sIOKCuSB3b3JsZAUses - and _ and usually no padding. For links, file names and JWTs.
When you decode, the tool detects which alphabet was used. If the bytes are not valid text, it shows a hex preview and lets you download them.
- Not encryptionAnyone can decode Base64. It hides nothing.
- About 33% largerEvery 3 bytes become 4 characters.
- Line breaks ignoredWrapped Base64, as in email, decodes normally.
- UTF-8 textCharacters such as ₹ use more than one byte.
Related encoding tools
Base64 makes bytes safe for text. URLs and tokens use related encodings.
For text in links and query strings, use the URL encoder and decoder. A JWT’s parts are Base64URL-encoded JSON, which the JWT decoder reads, and the hash generator fingerprints any text or file.
Common mistakes
Mistake: Using Base64 to protect passwords or keys.
Instead: Use real encryption; Base64 is only an encoding.
Mistake: Putting standard Base64 in a URL.
Instead: Use the URL-safe alphabet, or + and / will break the link.
Mistake: Decoding with a tool that reads text as Latin-1.
Instead: Decode as UTF-8 so ₹ and Indian scripts survive.
Read how we test our calculators, or browse more developer tools.