What is Base64?
Base64 represents binary data as text using 64 safe characters (A–Z, a–z, 0–9, + and /), three bytes becoming four characters, so the output is about 33% larger than the input. It exists so that binary content can travel through channels designed for text — e-mail, JSON, URLs and HTTP headers. It is an encoding, not encryption: anyone can decode it.
Security note: Base64 hides nothing. Credentials, tokens or personal data that are only Base64-encoded are effectively in plain text; use TLS in transit and real encryption at rest.
Read the guide: What is Base64? Encoding Explained
How to use Base64 Encoder
- Type text or choose a file.
- Pick URL-safe, padding and wrapping options as needed.
- Enable "data: URI" to embed the result in HTML or CSS.
- Copy or download the Base64 output.
Base64 Encoder features
- Encodes UTF-8 text or a local file (up to 5 MB) — nothing is uploaded
- Standard or URL-safe alphabet, with or without = padding
- Line wrapping at 76 (MIME) or 64 (PEM) characters
- data: URI output with automatic MIME type detection
- Recognises common file signatures (PNG, PDF, ZIP…) in the details
- Live encoding with size statistics
Base64 Encoder example
Encode Unicode text
Input:
Hello, MUTQAN TOOLS! مرحبا 🚀Output:
SGVsbG8sIE1VVFFBTiBUT09MUyEg2YXYsdit2KjYpyDwn5qAHel is 3 bytes and starts the example’s output as SGVs; the Arabic م alone is 2 bytes, so it ends in one “=”.Hel — the first 3 bytes of the example
Text
H e l
UTF-8 bytes (hex)
48 65 6c
Bits
01001000 01100101 01101100
6-bit groups
010010 000110 010101 101100
Value (0–63)
18 6 21 44
Base64
S G V s
م — one Arabic letter, 2 UTF-8 bytes
Text
م
UTF-8 bytes (hex)
d9 85
Bits
11011001 10000101 00
6-bit groups
110110 011000 010100
Value (0–63)
54 24 20
Base64
2 Y U =
Solid lines mark byte boundaries, dashed lines the 6-bit groups. Faded cells are not from the input: the zero bits and “=” of padding, and the empty slot of the missing byte.
Frequently asked questions about Base64 Encoder
What is the difference between Base64 and Base64url?
Base64url (RFC 4648 §5) replaces "+" with "-" and "/" with "_" and usually drops the "=" padding, so the result is safe in URLs, file names and JWTs without percent-encoding.
How are non-English characters handled?
Text is first converted to UTF-8 bytes, so Arabic, Hindi, emoji and any other Unicode text round-trips correctly. Decoders must also read the bytes as UTF-8.
When should I use line wrapping?
MIME email bodies use 76-character lines and PEM files use 64. Data URIs, JSON values and HTTP headers must stay on one line — leave wrapping off there.
Does Base64 encrypt my data?
No. It is a reversible encoding that anyone can decode. Use it to transport binary data as text, never to hide secrets.
Why is the output longer than the input?
Every 3 bytes become 4 characters, so Base64 is about 33 % larger than the raw bytes (plus line breaks if wrapping is enabled).
Technical notes
Base64 (RFC 4648) maps every 3 input bytes to 4 characters from a 64-character alphabet; the final group is padded with "=". Text is converted to UTF-8 first, so the output is byte-exact and interoperable with atob/btoa (after UTF-8 handling), Buffer.from(..., "base64") and base64 command-line tools.
References
- RFC 4648: The Base16, Base32, and Base64 Data EncodingsThe Base64 and Base64url alphabets, padding rules and the hex (Base16) encoding.
- Base64 — MDN Glossary — MDNBase64 in the browser: btoa/atob, the URL-safe variant and the size overhead of encoding binary data.
- RFC 2397: The "data" URL schemeHow small files are embedded in a URL as data:<mediatype>;base64,<data>.