Base64 Encoder
Encode / decode text or files
File is processed in your browser. Up to ~50 MB recommended.
About Base64 Encoder
What Base64 is and why it exists
Base64 is a way to represent arbitrary binary data — an image, a PDF, a cryptographic key — as plain ASCII text. The 8-bit-per-byte source is regrouped into 6-bit chunks; each 6-bit value (0–63) maps to one of 64 printable characters (A-Z, a-z, 0-9, +, /), with = as padding. The result is roughly 33% larger than the original, but it survives any text-only transport: email bodies (MIME's original use case), JSON payloads, URLs (with - and _ swapped in for + and /), CSS url(data:…) embeds, JWT segments, and SMTP attachments.
Base64 is not encryption — it's a reversible encoding. Anyone with the encoded string can decode it. Use it for transport-safety, not secrecy.
What this tool does
- Text ↔ Base64, UTF-8 safe (handles emoji, CJK, accented characters correctly).
- File ↔ Base64, with automatic MIME type detection so you can paste the output straight into an
<img src="data:image/png;base64,…">or a CSSbackground-image: url(data:…)embed. - Base64 → file download for decoded binaries — paste a chunk you saw in an API response, get the underlying PDF/image back.
- URL-safe variant (
-for+,_for/, no padding) — the form JWTs and signed URLs use. - All processing in your browser. No uploads. Safe for sensitive payloads (API keys, JWTs, certificates).
Common use cases
- Embed an image in HTML/CSS without a separate request. Tiny icons (under ~5 KB) often perform better inlined.
- Decode the payload of a JWT to inspect claims. Each JWT segment is URL-safe Base64.
- Inspect a
data:URL you found in scraped HTML — extract the original image. - Send binary data through a JSON API that only accepts strings.
- Reconstruct a file from an email or log that has it Base64-encoded.
- Generate a fingerprint of a binary you can compare across systems (combined with the Hash tool).
Frequently asked questions
No. Base64 is encoding, not encryption. It's a deterministic, reversible representation of bytes as text. Anyone with the encoded string can decode it back to the original. For secrecy, encrypt the data first (e.g. AES) and then Base64-encode the ciphertext for transport.
Yes — by roughly 33%. Every 3 bytes of source become 4 characters of Base64. For very small files (icons, fonts under ~5 KB) this overhead is worth saving an HTTP request; for larger files, inlining is usually slower than serving them separately.
Standard uses `+` and `/` and pads with `=`. URL-safe Base64 swaps `+` → `-` and `/` → `_` so the result is safe in a URL or filename, and usually drops the `=` padding. JWTs and many signed-URL schemes use the URL-safe variant.
Most likely a character-encoding mismatch — the source was UTF-16 or another encoding and you decoded as UTF-8. Or the input wasn't valid Base64 (missing padding, wrong character set). This tool decodes assuming UTF-8 text output; for raw binary, use the file-decode option.
The encoding runs entirely in your browser — the value never leaves your machine. That said, treat Base64-encoded secrets the same as the original secret: a Base64 string in a logfile or chat message is still a leaked credential.
Embed this tool on your site
Drop a one-line iframe snippet into any blog, lesson plan, or knowledge base. Powered-by-Toolenza link included.
Embed this tool
Paste this snippet into any HTML page. The tool runs entirely in your reader's browser.
Related tools
Base64 Encoder
No reviews yet — be the first to share your thoughts.
- No reviews yet — be the first to share your thoughts.