Base64 Encoder / Decoder
ConverterEncode text to Base64 or decode Base64 back to plain text with full UTF-8 support. Instant bidirectional conversion with one-click copy for any string.
About Base64 Encoder / Decoder
Base64 encodes binary data using 64 printable ASCII characters (A-Z, a-z, 0-9, +, /), making it safe to transport binary content over text-based protocols like JSON, HTTP headers, and email. This tool offers bidirectional text ↔ Base64 conversion, with all computation done locally in your browser. It correctly handles UTF-8 encoded input, supports standard Base64 with = padding as well as URL-safe Base64URL variant (using - and _), and detects whether padding is present or missing. Common use cases include embedding images as data URIs, transmitting binary in JSON APIs, and encoding JWT segments — all processed on your device with no data uploaded. Tip: Bookmark this tool for quick access whenever you need format conversion. All processing happens locally in your browser — no data upload, so feel free to paste sensitive content.
How to Use
- Open the Base64 Converter tool
- Choose Encode or Decode mode
- Paste text or upload a file in the input area
- Click the Convert button, results appear in real-time
- Copy the converted result
Use Cases
- Inline images via Data URI — Embed small images as Base64 directly in CSS or HTML to eliminate extra HTTP requests.
- Binary in API payloads — JSON has no binary type, so files and crypto results are commonly transmitted as Base64 strings.
- Debug JWTs — JWTs are three Base64URL segments — decode them individually to inspect header and payload.
- Email attachments — SMTP requires attachments to be Base64-encoded for transport over text-based email.
- Config-file secrets — Certificates and keys are often stored as Base64 in YAML or JSON configuration files.
- Binary data debugging — Decode Base64 strings from API responses to inspect the raw binary content they actually contain.
- JWT segment decoding — Decode each Base64URL segment of a JWT separately to examine the header, payload, and signature sections.
FAQ
Is Base64 encryption?
No. Base64 is encoding — anyone can decode it instantly. For confidentiality, use AES (see our AES Encryption tool).
Why does encoded data get larger?
Base64 uses 4 characters to represent 3 bytes, an ~33% size increase — the cost of squeezing arbitrary binary into a text channel.
What's the difference between Base64 and Base64URL?
Base64URL replaces + and / with - and _, and drops the = padding, making it safe in URLs and filenames. JWTs use Base64URL.
Why does decoding fail?
Common causes: (1) non-Base64 characters like newlines or spaces; (2) missing = padding; (3) URL-safe variant not converted back to + and /.
Can I encode images?
Yes — read the image as a binary Blob/ArrayBuffer first, then encode. Or use our File to Base64 tool to drag-and-drop directly.
Any browser compatibility requirements?
This tool works in all modern browsers (Chrome, Firefox, Edge, Safari). No plugins or extensions required.
Can I use it offline?
After initial load, most features work offline. The core logic runs entirely in your browser with no network dependency.
Comments
Comments are stored locally in your browser. Configure Giscus for cloud-based comments.