Base64 encoding is a standard method for representing binary or text data as a sequence of printable ASCII characters. Our free online Base64 encoder and decoder lets you convert text to Base64 and back instantly, with full UTF-8 support for accented characters and non-Latin scripts.
What is Base64?
Base64 is a binary-to-text encoding scheme that represents binary data using only 64 printable characters: A–Z, a–z, 0–9, +, and /. The name comes from the 64-character alphabet. It is not encryption - it is a reversible encoding that makes binary data safe to transmit over channels that only handle text.
Base64 is used in many places you might not expect:
- Email attachments - MIME encoding uses Base64 to embed binary files in text-based email messages.
- Data URIs -
data:image/png;base64,...embeds images directly in HTML or CSS without a separate HTTP request. - Authentication - Basic Auth sends credentials as
Base64(username:password)in the Authorization header. - JWT tokens - the header and payload of a JSON Web Token are Base64url-encoded.
- API payloads - some APIs transmit binary data (like images or PDFs) as Base64 strings within JSON.
How to Use the Base64 Encoder/Decoder
- Choose your operation - select "Encode" to convert plain text to Base64, or "Decode" to convert a Base64 string back to plain text.
- Paste your input - type or paste the text (or Base64 string) into the input field. For encoding, you can paste any UTF-8 text including accented characters.
- Copy the result - the output appears instantly. Click the copy button to grab the encoded or decoded string.
Common Use Cases
- Encoding credentials for HTTP Basic Authentication headers
- Creating data URIs for embedding images in HTML or CSS
- Decoding JWT token payloads to inspect their contents
- Encoding binary file contents for JSON API payloads
- Obfuscating configuration values in environment variables (not secure, but common)
- Transmitting special characters safely through systems that only accept ASCII
Frequently Asked Questions
Does Base64 encoding make data secure? No. Base64 is encoding, not encryption. Anyone who sees a Base64 string can decode it trivially. Never use Base64 alone to protect sensitive data.
Why does Base64 output end with = signs?
Base64 encodes 3 bytes of input into 4 characters. If the input length is not a multiple of 3, padding characters (=) are added to make the output length a multiple of 4.
What is the difference between Base64 and Base64url?
Standard Base64 uses + and / as the 62nd and 63rd characters. These characters have special meaning in URLs, so Base64url replaces them with - and _ respectively. JWTs use Base64url without padding.
Does the tool handle Unicode characters correctly?
Yes. The tool converts UTF-8 characters to their byte representation before encoding, so characters like é, ñ, or 中 are encoded correctly and can be decoded back without loss.
Use the Base64 Encode/Decode tool free, no sign-up required.