Base64 Encoder & Decoder
Encode and decode Base64 strings quickly and easily.
About this tool
Convert between plain text (or binary) and Base64 without switching to a terminal. Useful when you need to drop a tiny SVG straight into a CSS background-image rule, decode a JWT payload to peek at its claims, unpack an email MIME part, or generate a Basic-Auth header from "user:pass" without reaching for btoa in the dev console. UTF-8 is handled correctly, so emoji, accented characters, and non-Latin scripts round-trip exactly — no double-encoded mojibake. The whole conversion happens in your browser, which matters when the string you're decoding is someone's session token or an Authorization header. Paste, toggle encode or decode, copy the result. Works on strings up to several megabytes; for larger binary files, use the CLI.
Variants
Base64 Encode
Encode text to Base64 in your browser. For inlining SVGs in CSS, building Basic-Auth headers, or packing binary data into URL-safe ASCII.
Base64 Decode
Decode Base64 back to plain text in your browser. Peek at JWT payloads, unpack email MIME parts, or read Basic-Auth strings without a server round-trip.
Features
- Encode text to Base64 format instantly
- Decode Base64 strings back to plain text
- Handle UTF-8 characters correctly
- Copy encoded or decoded output to clipboard
How to Use
- Paste your text or Base64 string into the input field
- Select "Encode" or "Decode" mode
- View the converted result instantly
- Copy the output using the copy button
Frequently Asked Questions
What's the difference between Base64 and base64url?
Standard Base64 uses + and / as the 63rd and 64th characters and = for padding. base64url (RFC 4648 §5) swaps those for - and _ and usually drops the padding, so the output is safe to drop into URLs, filenames, and JWT parts without escaping.
Is Base64 encryption?
No. Base64 is a 1:1 reversible encoding anyone can decode — treat the output as "plain text dressed up as ASCII", not as a secret. If you're encoding a password or API token, the token is still the secret; Base64 just makes it transport-safe.
Why is my Base64 output 33% longer than the input?
Base64 represents every 3 bytes of input as 4 printable ASCII characters — a fixed 4/3 expansion, plus up to 2 padding characters. That's the price of going from an 8-bit alphabet to a 6-bit one; it's expected, not a bug.
Can I Base64-encode a binary file here?
For text and short binary blobs yes, but for real file conversion use the Image-to-Base64 tool (for images) or a CLI like `base64 < file.bin` for large binaries — pasting a 50 MB file into a textarea won't end well.
Why does my decoded output look like random characters?
Either the input wasn't actually Base64, or the decoded bytes aren't valid UTF-8 text. Try switching the output mode to binary or hex, or decode with a CLI like `echo '...' | base64 -d`. Some producers also use base64url; the leading `-` or `_` is a giveaway.
Is the Base64 I paste logged anywhere?
No. Encoding and decoding both run entirely in the browser using btoa/atob — nothing is sent to a server or stored locally. That matters because Base64 is often used to smuggle secrets (JWTs, Basic-Auth headers), and those strings shouldn't land in server logs.