Base64 Encoder & Decoder
Encode and decode Base64 online. Convert text to Base64 or decode Base64 back to readable text, with a URL-safe mode for tokens, filenames, and URLs.
What is Base64 encoding?
Base64 is a binary-to-text encoding scheme that represents any sequence of bytes using only 64 printable ASCII characters (A–Z, a–z, 0–9, +, /, with = used for padding). It doesn't compress or encrypt data — it simply re-encodes it into a format that is safe to transmit through systems designed to handle plain text, such as email (MIME), JSON payloads, HTTP headers, and configuration files.
Every 3 bytes of input become 4 Base64 characters, which is why encoded output is roughly 33% larger than the original data. Decoding reverses the process exactly, recovering the original bytes with no loss.
Common uses of Base64
- Data URIs — embedding small images or fonts directly inside CSS or HTML (
data:image/png;base64,...). - HTTP Basic Authentication — the
Authorization: Basicheader carriesusername:passwordBase64-encoded. - JSON Web Tokens (JWT) — the header and payload segments are Base64url-encoded JSON. See our JWT Decoder.
- Email attachments — MIME encodes binary attachments as Base64 text.
- Storing binary in text-only fields — databases, environment variables, or APIs that only accept plain text.
Examples
| Input | Base64 (standard) | Base64 (URL-safe) |
|---|---|---|
Hello, World! | SGVsbG8sIFdvcmxkIQ== | SGVsbG8sIFdvcmxkIQ |
user:pass123 | dXNlcjpwYXNzMTIz | dXNlcjpwYXNzMTIz |
{"a":1} | eyJhIjoxfQ== | eyJhIjoxfQ |
Frequently asked questions
How do I encode text to Base64 online?
Type or paste your text into the input box and click Encode. The Base64 encoder converts it instantly in your browser, with an optional URL-safe mode.
How do I decode a Base64 string?
Paste the Base64 string into the input box and click Decode. The decoder converts it back to readable UTF-8 text immediately.
Is Base64 encoding the same as encryption?
No. Base64 is a reversible encoding scheme, not encryption. Anyone can decode a Base64 string back to its original form without a key or password. Never use Base64 alone to protect sensitive data.
What is URL-safe Base64?
Standard Base64 uses + and / characters and = padding, which have special meaning in URLs and filenames. URL-safe Base64 (also called Base64url) replaces + with -, / with _, and usually omits padding, so the result can be used safely inside URLs, filenames, and tokens like JWTs.
Why does my decoded text look garbled?
This usually means the input isn't valid Base64 for the text you expect, it's missing padding, or it actually encodes binary data (like an image) rather than readable text. This tool decodes Base64 as UTF-8 text; for binary files use a dedicated file tool.