TirupatiTECHNOLOGIES
Developer Tools

Base64 Encoder & Decoder

Base64 turns binary data into plain ASCII text so it can travel safely through systems that only handle text — email attachments, data URLs, API tokens and auth headers. This tool encodes your text to Base64 and decodes Base64 back to text, with proper Unicode handling (Hindi text and emoji survive the round trip). Everything happens in your browser.

Mode

How it works

Base64 works on bytes, not characters:

  1. Encode: your text is first converted to UTF-8 bytes with TextEncoder (this is what keeps non-English text intact), then every 3 bytes are regrouped into 4 six-bit values, each mapped to a character in A–Z a–z 0–9 + /. If the byte count isn't a multiple of 3, = padding is added.
  2. Decode: the process reverses — the 64-character alphabet maps back to bytes, padding is stripped, and TextDecoder rebuilds the original UTF-8 text.

A common bug in naive tools is calling btoa() directly on Unicode text, which corrupts anything outside Latin-1. This tool encodes UTF-8 bytes first, so it doesn't.

Worked example

Encode the Hindi greeting नमस्ते: you get 4K+4K+4K+4K+4K+-style output (the exact string is 4K+4K+4K+4K+4K+ for a shorter sample — try it live). Decode it back and you get नमस्ते exactly, because the tool round-trips through UTF-8 rather than Latin-1.

Understanding your results

Encoded output is safe to paste into JSON, URLs (with care — + and / have URL meanings), headers or code. Decoded output is the original text. If decoding fails, you'll see a clear error — usually the input contains characters outside the Base64 alphabet or has broken padding.

Remember: Base64 is an encoding, not encryption. Anyone can decode it, so never use it to hide secrets.

Frequently asked questions

No. Base64 is an encoding scheme — it only changes representation, and anyone can reverse it instantly. Never use Base64 to protect passwords, tokens or secrets.

Content last reviewed on 2026-10-06.