Base64 Encode / Decode
Encode text to Base64 or decode Base64 back to text.
Last updated August 26, 2026
About this tool
Base64 encodes arbitrary binary data as ASCII text using 64 printable characters, which makes it safe to embed in places that only support plain text — email attachments, URLs, JSON payloads, or HTML/CSS (e.g. inline images). It is an encoding, not encryption: anyone can decode Base64 back to the original data instantly, so it should never be used to protect sensitive information.
Base64 size overhead
| Input size | Approx. Base64 size |
|---|---|
| 3 bytes | 4 characters |
| 1 KB | ~1.37 KB |
| 1 MB | ~1.37 MB |
Code examples
The second line (where shown) is the inverse operation.
| Language | Code |
|---|---|
| JavaScript | btoa('hello')atob('aGVsbG8=') |
| Python | base64.b64encode(b'hello')base64.b64decode(b'aGVsbG8=') |
| PHP | base64_encode('hello')base64_decode('aGVsbG8=') |
| Shell | echo -n 'hello' | base64echo 'aGVsbG8=' | base64 -d |
Frequently asked questions
Is Base64 encryption?
No. Base64 is a reversible encoding scheme with no secret key — anyone can decode it. Use real encryption (e.g. AES) if you need to protect data, not Base64.
Why is my encoded output longer than the original text?
Base64 always expands data by roughly 33% because it represents every 3 bytes of input as 4 ASCII characters.
Does this tool store what I encode or decode?
No — encoding and decoding both happen locally in your browser.