2026topopentools

Base64 Encode / Decode

Convert text to Base64 or decode Base64 back to readable text instantly, with full Unicode support.

Result appears here…

Understanding the Base64 Encode / Decode

Base64 represents binary or text data using 64 printable ASCII characters, making it safe to embed in JSON, data URLs, email, and HTTP headers that expect text. This tool encodes any string into Base64 and decodes Base64 back to readable text, handling Unicode such as emoji and accented characters correctly. It is built for developers debugging tokens, basic-auth headers, and data URIs. Encoding and decoding run in your browser, so secrets and payloads stay on your device and are never transmitted to a server.

How it works

Encoding maps every 3 bytes of input to 4 Base64 characters, padding with '=' when the length is not a multiple of three. Browsers expose btoa() and atob(), but those only handle Latin-1, so this tool first converts text to UTF-8 bytes with TextEncoder, then Base64-encodes the bytes; decoding reverses the steps with TextDecoder. That makes multi-byte characters lossless. The output grows about 33 percent versus the input. Read encoded output as opaque text; decoded output is your original string. All processing is local JavaScript, so nothing leaves the page.

encoded_length ≈ 4 × ceil(input_bytes / 3)

Worked example

Encoding the word "Hi" gives "SGk=": two bytes become four characters, with one '=' pad because the input was not a multiple of three. Encoding "cafe" with an accented e ("café") yields "Y2Fmw6k=" because the é expands to two UTF-8 bytes before encoding. Decoding "SGVsbG8=" returns "Hello". A 9-character ASCII string produces 12 Base64 characters, matching the rule that output is four characters for every three input bytes.

Tips & common mistakes

  • Base64 is encoding, not encryption; anyone can decode it, so never use it to hide secrets.
  • Use this tool's Unicode-safe mode for emoji and accents; raw btoa() throws on them.
  • URL-safe Base64 replaces + with - and / with _; convert if a token rejects standard characters.
  • Whitespace and newlines in pasted Base64 are usually ignored, but stray characters cause decode errors.
  • Padding '=' is required by most decoders; don't strip it unless the target spec allows it.

Related tools

Frequently Asked Questions

What is Base64?

Base64 is a way to represent binary or text data using 64 ASCII characters. It is commonly used to embed data in URLs, JSON, emails, and data URIs.

Does it support emoji and accents?

Yes. The tool encodes and decodes using UTF-8, so emoji, accented letters, and non-Latin scripts all work correctly.

Is my text private?

Yes. Encoding and decoding happen entirely in your browser — nothing is sent to a server.