Base64 Encode / Decode
Convert text to Base64 and back, entirely in your browser — nothing you paste here is uploaded anywhere. Full Unicode support, both standard and URL-safe alphabets accepted, and clear errors for invalid input instead of silent corruption.
Base64 converter
Example: "Hello, world!" encodes to SGVsbG8sIHdvcmxkIQ==
What Base64 is for
Many systems — email bodies, JSON documents, URLs, XML, configuration files — can only carry plain text safely. Base64 bridges the gap: it rewrites any sequence of bytes using 64 text-safe characters (A–Z, a–z, 0–9, + and /), so binary data like images, keys, or attachments can travel through text-only channels and arrive bit-perfect.
The mechanics: every 3 bytes (24 bits) are split into four 6-bit groups, and each group
selects one character from the 64-character alphabet. "Hello, world!" becomes
SGVsbG8sIHdvcmxkIQ==; the example is computed by this page's own encoder at build time, as
is the Unicode case café ☕ → Y2Fmw6kg4piV.
Where you meet it
Data URIs (data:image/png;base64,…), email attachments (MIME), JSON web tokens
(JWTs use the URL-safe variant for each segment), basic HTTP authentication headers, inline
fonts and images in CSS, and API payloads that must embed binary content. If a blob of
gibberish ends in one or two = signs, it is very likely Base64.
A note on security
Because the alphabet is public and the mapping is fixed, decoding requires no secret. Treat Base64 exactly like plain text for security purposes: anything sensitive should be encrypted before (or instead of) being Base64-encoded. This page's converter runs locally, so pasting sensitive text here does not transmit it — but it also does not protect it.
Frequently asked questions
Is Base64 encryption?
No. Base64 is an encoding, not encryption — anyone can decode it instantly, with no key. Use it to transport data safely through text-only channels, never to protect secrets.
Why is Base64 output about a third larger than the input?
Base64 represents every 3 bytes of data as 4 characters drawn from a 64-character alphabet, so output length is ceil(n/3) × 4 — roughly 133% of the input, plus = padding to reach a multiple of four.
What do the = signs at the end mean?
Padding. When the input length is not a multiple of 3 bytes, the final group is padded: one leftover byte produces ==, two produce =. Many decoders (including this one) also accept input with the padding omitted.
What is URL-safe Base64?
A variant (RFC 4648 §5) that replaces + with - and / with _ so encoded data can travel inside URLs and filenames without percent-encoding. This decoder accepts both alphabets automatically; the encoder emits the standard one.
Does this handle emoji and non-English text?
Yes. Text is converted through UTF-8 bytes before encoding, so any Unicode content round-trips exactly. Decoding validates that the bytes are real UTF-8 and reports an error instead of showing garbled characters.
Conversion is implemented as tested, typed functions verified against the RFC 4648 test vectors — see the methodology page.