Base64 encoding and decoding for strings & files
Base64 is an encoding scheme that converts binary data into plain ASCII text. It uses 64 printable characters (A-Z, a-z, 0-9, +, /) to represent arbitrary byte sequences, and is widely used to transmit binary content over text-based protocols.
Every 3 bytes of binary data → 4 Base64 characters, resulting in roughly 33% size increase. When the byte count is not a multiple of 3, = padding is added.
| Standard Base64 | Base64URL | |
|---|---|---|
| Charset difference | + / = |
- _ (no =) |
| Use cases | Email, Data URLs | JWT, URL params, filenames |
Base64 is encoding, not encryption — anyone can decode it. Never use it to protect sensitive data.
Make sure encoding and decoding use the same character set. This tool defaults to UTF-8. If the original data was encoded with GBK or another charset, convert it to UTF-8 first.
No. Standard Base64 contains +, /, and =, which have special meanings in URLs. Use the Base64URL variant instead, or URL-encode the result.
Base64 represents every 3 bytes with 4 characters — a fixed ~33% overhead. For large files, prefer binary upload over Base64 encoding.