📖 Guide Developer Tools

Base64 Encoding and Decoding: A Complete Guide

Advertisement
⚡
Base64 Encoder / Decoder

Encode or decode Base64 instantly — text, URLs, and files all supported.

Use this tool →

What is Base64?

Base64 is an encoding scheme that converts binary data into a string of ASCII characters. It was designed to safely transmit data over systems that were built to handle text — like email, HTTP headers, and JSON — which cannot reliably carry raw binary bytes.

The name comes from the fact that Base64 uses 64 characters to represent data: the uppercase letters A–Z, lowercase a–z, digits 0–9, and the symbols + and /. A 65th character, =, is used as padding.

How to encode text to Base64

Paste or type any text into the input panel and the Base64 output appears instantly in the right panel. Every character you type updates the output in real time. The ratio stat below the panels shows how much larger the Base64 version is compared to the original — typically 33–37% larger, because every 3 bytes of input become 4 characters of output.

How to decode Base64

Switch to Decode mode using the toggle button. Paste any valid Base64 string and the original text appears in the output panel. If the Base64 is malformed — wrong characters, incorrect padding — the tool shows an error message explaining the problem.

Standard Base64 vs URL-safe Base64

Standard Base64 uses + and / as part of its alphabet. These characters have special meanings in URLs and query strings — + means a space, and / separates path segments. If you are embedding Base64 in a URL, cookie, or file name, check the "URL-safe Base64" option. This replaces + with - and / with _, and optionally removes the = padding, producing a string that is safe to use anywhere in a URL without percent-encoding.

Common uses for Base64 encoding

API authentication is the most frequent use case — HTTP Basic Authentication requires credentials in the format username:password encoded as Base64 in the Authorization header. Embedding images in HTML or CSS is another common use, where an image's binary data is encoded as Base64 and placed directly in a data: URI, eliminating an HTTP request. Email attachments are encoded as Base64 since SMTP was designed for ASCII text. JSON APIs that need to transmit binary data (like file contents or cryptographic keys) use Base64 to represent the bytes as a string.

What Base64 is not

Base64 is an encoding, not encryption. Anyone who sees a Base64 string can decode it instantly — there is no secret involved. If you see "encrypted" data that is clearly Base64, it is not encrypted; it is just encoded. Actual encryption produces data that looks random and cannot be decoded without the key.

Privacy

All encoding and decoding happens in your browser. Nothing you enter is transmitted to any server. You can safely encode API keys, passwords, and sensitive documents.

Advertisement
🔧
Use the tool
Base64 Encoder / Decoder
💡
Pro Tips →
Base64 Encoder / Decoder
❓
Frequently Asked Questions
Common questions about Base64 Encoder / Decoder

📦 Recommended Resources

Handpicked books and tools — links may earn a small commission at no cost to you.