Base64 Encoder / Decoder
DataEncode any text or data to Base64, or decode Base64 strings back to plain text instantly. Free, client-side — nothing you paste is ever uploaded.
Reviewed by the thecalcu.com team · Last updated July 28, 2026
What is a Base64?
A Base64 Encoder / Decoder converts text to and from Base64 encoding, a scheme that represents binary or text data using only 64 safe ASCII characters (A–Z, a–z, 0–9, +, /) plus = for padding. Base64 was originally designed to allow binary file attachments to pass through email systems that only supported 7-bit ASCII text. Today it is ubiquitous in web development: HTTP Basic Auth headers, JWT tokens, data URIs for embedded images, and binary data in JSON APIs all rely on Base64.
This tool handles Unicode text correctly by encoding the input as UTF-8 bytes before applying Base64, ensuring that non-ASCII characters (accented letters, Indian scripts, emoji) are encoded faithfully and can be decoded back without loss. The encoder uses the standard Base64 alphabet; decoding accepts standard Base64 with or without padding.
Base64 is an encoding, not encryption, anyone who sees a Base64 string can decode it in seconds. If you need to protect data, use encryption separately from encoding.
For URL encoding needs, the URL Encoder / Decoder handles percent-encoding. For JSON formatting, see the JSON Formatter.
Why Use a Base64 Encoder / Decoder?
The most common use case is debugging. When an API returns a Base64-encoded response (a token, a certificate, a file attachment), you need to decode it to read the underlying content. Similarly, when building an integration that requires Base64-encoded parameters, you need to verify your encoding is correct before sending.
Other frequent uses: extracting the payload section of a JWT to inspect claims, encoding credentials for an HTTP Basic Auth header to test with curl or Postman, and generating data URI strings for small inline images in HTML.
Who Should Use This Tool?
Backend and API developers, decode Base64 responses from APIs, encode test payloads, and inspect JWT token payloads.
Front-end developers, generate data URIs for small assets, verify encoded values in localStorage or cookies, and debug authentication headers.
DevOps and platform engineers, decode Kubernetes secrets (which are Base64-encoded), inspect certificate data, and verify environment variable encoding.
Security engineers, inspect encoded payloads in HTTP traffic, decode obfuscated strings in scripts (noting that Base64 is not encryption), and verify token structures.
What Insights Does This Formatter Give You?
Encoding mode takes any Unicode text and returns the standard Base64 representation of its UTF-8 byte sequence. The output can be copied directly into any context that accepts Base64-encoded data.
Decoding mode takes a Base64 string and returns the original text. If the input is invalid Base64, a clear error message explains the problem.
How to use this Base64 calculator
- Paste your input text (or Base64 string) into the Input field.
- Select Encode → Base64 or Decode ← Base64 from the Mode selector.
- The output appears instantly in the Output field.
- Click the copy icon on the output field to copy the result.
- For decoding, ensure the input uses only valid Base64 characters (A–Z, a–z, 0–9, +, /, =).
Formula & Methodology
Encoding (text → Base64): 1. Convert the input string to UTF-8 bytes (handles Unicode correctly) 2. Group bytes into 3-byte chunks 3. Convert each 3-byte chunk (24 bits) into four 6-bit values 4. Map each 6-bit value to a character in the Base64 alphabet (A–Z = 0–25, a–z = 26–51, 0–9 = 52–61, + = 62, / = 63) 5. Append=padding if the input length is not a multiple of 3 Decoding (Base64 → text): 1. Strip whitespace 2. Map each Base64 character back to its 6-bit value 3. Reassemble 6-bit groups into 3-byte chunks 4. Decode the bytes as UTF-8 text 5. Return a clear error if any character is outside the Base64 alphabet Valid example:Hello, World!→SGVsbG8sIFdvcmxkIQ==Invalid decode example:SGVsbG8!,!is not a valid Base64 character
Frequently Asked Questions