Base64 Encode / Decode

Convert text to/from Base64 locally in your browser.

Base64


Sponsored

How it works

How it works

Base64 encodes binary data by grouping the input into 24-bit blocks (3 bytes) and mapping them to four 6-bit values. Each 6-bit value is used as an index into a 64-character alphabet (A–Z, a–z, 0–9, +, /). If the input length is not a multiple of 3 bytes, the output is padded with one or two = characters.

  • Text is first converted to bytes using UTF‑8 (so emojis and non‑ASCII characters are preserved).
  • Every 3 input bytes → 4 output characters. 1 leftover byte → 2 chars + ==; 2 leftover bytes → 3 chars + =.
  • Decoding reverses the process, turning 4 Base64 chars back into 3 bytes, then decoding as UTF‑8 text.

Base64URL: JWTs and URLs often use a URL‑safe variant where +-, /_, and padding = is optional. This tool targets standard Base64; for URL‑safe, convert the alphabet accordingly.

Privacy & Security

All processing is local.

Accuracy, Limits & Tips

Only handles text. Binary files aren’t supported in this basic version.

Examples

  • Encode API keys for testing.
  • Decode Base64 snippets.

Looking for broader guides and best practices? Visit the ToolsAreUs Blog for indexes (like the full tool list) and articles (e.g. secure password generation).