What is this calculator for?
You need to embed an image inline in CSS or a JSON document. Or you're debugging an API authentication header (which is often Base64-encoded). Or you're working with email attachments which are Base64-encoded for transport. The Base64 encoder/decoder converts binary data to ASCII text and back — the fundamental tool for embedding binary content in text-only contexts.
Why Base64 exists. Many systems handle ASCII text reliably but treat binary data badly (email, URLs, JSON, HTTP headers, XML). Base64 converts any binary content to a stream of ASCII characters using 64 specific symbols (A-Z, a-z, 0-9, +, /, with = as padding). The resulting text is safe to send through text-only systems, then decoded back to the original binary on the receiving end. Used by: HTTP Basic Authentication, JSON Web Tokens, email attachments (MIME), data URIs in HTML/CSS, embedded images in PDFs.
This tool encodes plain text to Base64 and decodes Base64 back to plain text. For file encoding/decoding: use programming tools (Node.js, Python — the bytes-to-Base64 functions handle files larger than this tool can paste).
How to use this calculator
For encoding: paste text into the input. The tool outputs the Base64-encoded equivalent. "Hello, World!" becomes "SGVsbG8sIFdvcmxkIQ==". The "==" padding at the end is part of Base64 spec.
For decoding: paste Base64 text into the input. The tool outputs the decoded original. Invalid Base64 (wrong characters, wrong length) produces an error.
For URL-safe Base64: standard Base64 includes "+" and "/" which have special meanings in URLs. URL-safe Base64 substitutes "-" and "_" instead. Used in JWT tokens, URL parameters. The tool can encode/decode in both standard and URL-safe variants.
Understanding your results
The encoder outputs Base64 text from plain text input. The decoder outputs original text from Base64 input.
How Base64 works mathematically. Each 3 bytes of binary input become 4 characters of Base64 output. 3 bytes = 24 bits; each Base64 character represents 6 bits; 24 bits / 6 = 4 characters. So Base64 makes the data ~33% larger (4 characters represent what 3 bytes would). The 64 symbols cover all 6-bit combinations (2^6 = 64). Standard alphabet: A-Z (26), a-z (26), 0-9 (10), plus 2 special (+, /) = 64. Padding ("=") appears when input bytes aren't a multiple of 3.
Common Base64 uses you encounter. HTTP Basic Authentication: Authorization: Basic dXNlcjpwYXNzd29yZA== — "dXNlcjpwYXNzd29yZA==" is Base64 for "user:password". Note: HTTP Basic is essentially plaintext over the wire if not using HTTPS — Base64 encoding is not encryption. JWT (JSON Web Token): the dot-separated parts (header.payload.signature) are all Base64-encoded. Data URIs: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA... — inline images embedded in HTML/CSS. Email MIME attachments: binary files Base64-encoded for transport through email systems.
Base64 is NOT encryption. Encoding/decoding Base64 is fully reversible without any key. It's not secure for hiding secrets. If you've Base64-encoded a password thinking it's "encrypted," it's not — anyone with the Base64-encoded string can decode it back to plaintext in 2 seconds. For actual security: use real encryption (AES) plus secure key management.
The 33% size bloat. Base64 makes data 33% larger than the binary original. For 1 MB binary file: ~1.33 MB Base64-encoded. This is why data URIs aren't used for large images (the inflation eats bandwidth); they're used for small icons (under 5-10 KB). For HTTP: typically gzip compression reduces the Base64 bloat by ~25-30%, but the round-trip is still less efficient than transmitting binary directly.
A worked example
A developer is debugging an API authentication problem. The API requires HTTP Basic Authentication; she's getting 401 Unauthorized responses.
The request she's sending: Authorization: Basic dXNlckBleGFtcGxlLmNvbTpwYXNzd29yZA==
She decodes the Base64: "user@example.com:password" — that's the username + password she's using. The format is correct (username:password).
Issue identified: she's sending the wrong password. The actual API requires "RealPassword123" not "password". She re-encodes: "user@example.com:RealPassword123" → "dXNlckBleGFtcGxlLmNvbTpSZWFsUGFzc3dvcmQxMjM=". New request succeeds.
The Base64 decoder revealed the wire-protocol content, helping diagnose the actual credentials being sent (vs what she thought she was sending). Without the decoder: she'd have to manually decode by hand or look up the encoding logic — much slower for debugging.
Variation: a designer wants to embed a small icon (5 KB PNG) inline in CSS rather than as a separate file (to eliminate one HTTP request). She uses a Base64 encoder to convert the PNG to a data URI: background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...); — the entire image embedded as a string. Trade-off: CSS file is larger; one less HTTP request. For small icons, the trade-off favors data URIs; for large images, separate files win.
Related resources
For other encoding/decoding tools, see URL Encoder and Hash Generator. For JSON-specific handling, the JSON Formatter. For text manipulation, the Case Converter. The RFC 4648 is the authoritative IETF specification for Base16, Base32, and Base64 encodings.