Skip to content
Sandeep Kumar

Base64 Encode and Decode

Encode text to Base64 or decode it back as you type. It handles UTF-8 properly, so Hindi and emoji survive the round trip, and it reads URL-safe Base64 with or without padding. Everything runs in your browser.

text
base64
The result shows up here as you type.

What Base64 is for

Base64 turns any bytes into 64 safe characters (A–Z, a–z, 0–9, + and /) so binary data can travel through places built for text: JSON fields, email, HTTP headers, data URLs.

It is an encoding, not encryption. Anyone can decode it, so it hides nothing. The output is about a third larger than the input, because every 3 bytes become 4 characters.

Standard vs URL-safe Base64

Standard Base64 uses + and / and pads with =, all of which mean something in a URL. URL-safe Base64 (Base64URL) swaps them for - and _ and usually drops the padding. JWTs use it. This decoder accepts either form, so you don't have to convert first.

Why some decoders garble Hindi or emoji

The browser's built-in btoa and atob only understand one byte per character, so text outside Latin-1 either throws or comes back as junk. This tool converts text to UTF-8 bytes first, which is what servers and other languages expect. When the decoded bytes aren't text at all (an image or a key), it shows them as hex instead of garbage.

Related reading

More tools