Base64 Encoder / Decoder
Encode plain text or binary data to Base64, or decode a Base64 string back to its original form. All processing happens in your browser.
Input: 0 chars / 0 bytes · Output: 0 chars
How it works
Base64 encodes binary data as a sequence of printable ASCII characters. It divides input into 3-byte groups and maps each group to four characters from a 64-character alphabet (A–Z, a–z, 0–9, +, /). The output is always a multiple of 4 characters, padded with = if necessary.
Base64 is an encoding, not an encryption. Anyone can decode a Base64 string — there is no key involved. It is purely a way to represent binary data as text.
Common uses
- Data URIs — embed images directly in HTML or CSS:
url("data:image/png;base64,iVBOR...") - HTTP Basic Auth — the
Authorization: Basic <token>header encodesusername:passwordin Base64 - Email attachments — MIME encoding uses Base64 to transport binary attachments as plain text
- API tokens and JWTs — JWT uses a URL-safe variant of Base64 to encode its header and payload
- Config and secrets — many systems use Base64 to store binary values (like AES keys) in text configuration files
🔒 Privacy
All encoding and decoding happens in your browser using the built-in btoa/atob functions and the Web API TextEncoder. Your input is never sent to any server.
Edge cases and limits
- Empty input — encoding an empty string produces an empty string.
- Unicode — multi-byte characters (like emoji or accented letters) are encoded as UTF-8 bytes before Base64 conversion.
- Missing padding — when decoding, missing
=padding is tolerated; standard Base64 requires it, but URL-safe variants often omit it. - Invalid characters — characters outside the Base64 alphabet cause a clear error in decode mode.
- Large text — the tool handles reasonably large inputs (hundreds of kilobytes) without issue. Extremely large inputs may slow down the browser.
FAQ
Is Base64 the same as encryption?
No. Base64 is an encoding format, not an encryption scheme. It has no key, and anyone can decode it instantly. Never use Base64 to protect sensitive data.
What is URL-safe Base64?
Standard Base64 uses + and /, which have special meaning in URLs. URL-safe Base64 replaces these with - and _, and usually omits = padding. JWT tokens use this variant.
Why does Base64 output end with == ?
Base64 processes 3 bytes at a time. If the input length is not divisible by 3, one or two = characters are appended as padding to make the output a multiple of 4 characters.
How much larger is Base64 output than the input?
Base64 output is approximately 33% larger than the input — 3 input bytes become 4 output characters.