Base64 Converter
Encode and decode Base64 strings and files.
How Base64 Converter Works
What is Base64?
Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable ASCII characters. It is commonly used to embed binary content (images, files, certificates) in text-based formats like JSON, XML, HTML, or email.
The encoding increases data size by approximately 33%, but ensures the data can be safely transmitted through systems that only handle text.
How to Use
- Paste text or Base64; the output updates as you type. Auto decodes Base64 that turns into text, and long blocks of Base64 data, and encodes everything else. Encode and Decode fix the direction.
- Decoding takes Base64 as it arrives: behind a
data:prefix, in a PEM block with its-----BEGINlines, broken into lines, with the URL-safe-and_, or without=padding. - Alphabet sets how text and files are encoded: Standard, or URL-safe without padding, for addresses and file names.
- Use Upload file or drop a file onto the field to encode it. The output holds the raw Base64, and a ready-to-use Data URI appears below it.
- Decoded data that is not text is not shown, since showing it as text would change it. Download saves the exact bytes, named after the file type where it is recognised.
- The dice loads a random example: text to encode, Base64 to decode, a data URI, a PEM key or a URL-safe string.
Common Use Cases
| Data URI | Embed images directly in HTML/CSS without separate files |
| API Payloads | Send binary data in JSON request bodies |
| MIME encoding for attachments and non-ASCII content | |
| Certificates | PEM format wraps DER-encoded certificates in Base64 |
| Config Files | Store binary secrets in YAML, TOML, or .env files |
Important Notes
- Base64 is not encryption. It is a reversible encoding and provides no security. Do not use it to protect sensitive data.
- Encoded output is about a third larger than the input. Short input grows more, because Base64 writes in groups of four characters:
abecomesYQ==. - File uploads are limited to 10 MB.
- Text is encoded as UTF-8, so emoji and every other script come back exactly as they went in.
Privacy & Security: All encoding and decoding runs entirely in your browser. No data is sent to any server.
Mode
Alphabet