What is Base64?
Base64 is one of the oldest and most widely-used encoding schemes on the internet. It takes arbitrary bytes — binary files, Unicode strings, cryptographic keys — and rewrites them using only 64 printable ASCII characters. That means the result is safe to embed in places that historically could not carry raw binary: email headers, URL query strings, JSON fields, HTTP basic authentication, XML documents, and configuration files.
Every three input bytes become four Base64 characters, so encoded output is about 33% larger than the original. The encoding is fully reversible — there is no secret key, and anyone can decode it. It solves a transport problem, not a security problem.
How to use this tool
- Pick a mode — Encode to turn text into Base64, Decode to go the other way.
- Type or paste your input into the left panel.
- Click Convert. The result appears on the right, or an error message if the input is invalid Base64.
- Click Copy to put the result on your clipboard, or Clear to reset.
Worked examples
Example 1 — encoding a short string:
Hello, world!Encoded:
SGVsbG8sIHdvcmxkIQ==Example 2 — Unicode round-trip:
안녕하세요 🌍Encoded:
7JWI64WV7ZWY7IS47JqUIPCfjI0=Decode that string in the tool and you get the original Korean greeting and globe emoji back.
Example 3 — HTTP basic auth header:
alice:s3cretEncoded:
YWxpY2U6czNjcmV0That is exactly the value that follows Authorization: Basic in an HTTP request. Because it is not encrypted, always use HTTPS whenever Basic Auth is in play.
Common use cases
- Inlining small images in CSS or HTML with
data:image/png;base64,…URIs. - Generating or decoding HTTP Basic Authentication headers.
- Embedding binary blobs (certificates, keys, fonts) inside JSON or YAML config files.
- Transporting UTF-8 text through email or legacy systems that mangle non-ASCII bytes.
- Debugging JWTs — the header and payload sections of a JWT are Base64URL-encoded JSON.
- Decoding random Base64 strings you find in logs, URLs, or message queues.
Base64 vs. Base64URL
Standard Base64 uses + and / in its alphabet, which clash with URL and filename syntax. A variant called Base64URL replaces those with - and _ and usually drops the trailing = padding. If a string contains - or _, it is probably Base64URL — convert those back to + and / (and restore padding) before decoding with this tool.
Frequently asked questions
What is Base64 encoding?
Base64 is an encoding scheme that turns binary data into a 64-character ASCII alphabet (A–Z, a–z, 0–9, +, /, plus `=` for padding). It is not encryption — the encoded text is fully reversible and offers no secrecy on its own.
Why encode text to Base64?
Because many text-based systems — email headers, JSON payloads, URL query strings, HTTP basic auth — cannot safely carry raw binary or unusual characters. Base64 guarantees the output is plain ASCII that survives transport through those channels.
Does this tool handle Unicode characters?
Yes. The encoder first UTF-8-encodes the input, so emojis, accented characters, CJK text, and any other Unicode content round-trip correctly. The decoder reverses the process.
Is Base64 the same as encryption?
No. Base64 is trivially reversible and provides zero confidentiality. If you need to protect data, use a real encryption algorithm such as AES. Base64 only changes the alphabet; it does not hide the content.
Why is my Base64 input failing to decode?
The most common causes are stray whitespace or line breaks, missing padding `=` characters at the end, or characters from URL-safe Base64 (`-` and `_`) that the standard decoder does not accept. Clean the string and try again.
Is my data sent anywhere?
No. Encoding and decoding run entirely in your browser using native `btoa`/`atob` APIs. Nothing is uploaded, stored, or logged.
Related reading
- Base64 Encoding Explained: How It Works and When to Use It — a deeper look at the algorithm, the alphabet, and real-world use cases.
- JSON Formatter — pair Base64 with JSON when working with API payloads that embed binary blobs.