Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 strings — supports Unicode
Real-Life Guide to Using the Base64 Encode/Decode
Encode or decode Base64 strings
When this calculator is useful
Use this when you need to embed binary-safe data as text — for example inlining a small image in CSS with a data URI, decoding a JWT payload segment, or reading a Base64-encoded API credential or attachment.
Common Mistakes
- Treating Base64 as encryption — it is a reversible encoding scheme with no secret key, so anyone can decode it back to plaintext in seconds; never use it to "hide" passwords or tokens.
- Forgetting padding characters (=) at the end of an encoded string when copying it manually, which breaks strict decoders expecting length divisible by 4.
- Mixing up standard Base64 (using + and /) with URL-safe Base64 (using - and _), which matters when decoding tokens from URLs or JWTs that use the URL-safe variant.
- Trying to decode a string that is not valid Base64 (wrong length, invalid characters) and getting garbled or truncated output instead of a clear error.
- Assuming encoding a large file inline always saves space — Base64 output is roughly 33% larger than the original binary data, since 3 bytes of input become 4 characters of output.
How to Interpret Results
Encoding converts raw bytes or text into a plaintext-safe ASCII string; decoding reverses that back to the original bytes — if decoding produces unreadable characters, the input was likely not valid Base64 or was encoded with a different variant (standard vs. URL-safe).
Base64 Encode/Decode FAQs
What is Base64?
Base64 is an encoding scheme that represents binary data as ASCII text using 64 printable characters (A–Z, a–z, 0–9, +, /). It's commonly used to embed images in HTML/CSS, encode email attachments (MIME), store binary data in JSON, and pass data through systems that only handle text.
Base64 increases data size by ~33% (every 3 bytes becomes 4 characters). It is NOT encryption — it's trivially reversible. Never use it to "hide" sensitive data. This tool handles Unicode text correctly by using UTF-8 encoding before Base64 conversion.