Base64 represents binary data using only letters, digits and a few symbols, so it can travel through systems built for text: email, JSON, HTML, URLs and HTTP headers. Developers meet it in API credentials, data URIs, JWTs and file uploads.
Common uses
- APIs: encode credentials for HTTP Basic auth or binary data inside JSON.
- Web pages: embed small images or fonts as data URIs.
- Debugging: decode values from tokens, headers and logs.
- Config: store certificates or keys in environment variables.
For images specifically, the Image to Base64 tool also produces ready-made HTML and CSS snippets.
How to use the Base64 Encode & Decode
- In the Text tab, type or paste text and choose Encode or Decode.
- Tick URL-safe for Base64 used in URLs, file names and JWTs.
- In the File tab, drop any file to get its Base64 or a data URI.
- To turn Base64 back into a file, paste it in the File tab and click Decode and download.
Features
- UTF-8 encoding, so emoji and accented letters round-trip correctly (unlike plain btoa).
- Standard (RFC 4648) and URL-safe Base64, with or without padding.
- Files of any type up to 50 MB, with an optional data:…;base64, prefix.
- Decoding detects the file type from its content and picks the right extension.
- Clear message when Base64 decodes to binary data instead of text.
Frequently asked questions
Why is Base64 about a third bigger than the original?
Base64 turns every 3 bytes into 4 printable characters, so output is roughly 133% of the input size, plus padding.
Is Base64 encryption?
No. Base64 is an encoding, not encryption: anyone can decode it instantly. Use the AES Encrypt & Decrypt tool if you need to protect data.
What is URL-safe Base64?
Standard Base64 uses + and /, which have special meanings in URLs. The URL-safe variant replaces them with - and _ and usually drops the = padding. JWTs use this form.
Why does btoa fail on some text?
The browser’s btoa only accepts characters with codes up to 255, so emoji and many languages throw an error. This tool encodes text as UTF-8 bytes first, which works for any character.
Written by Dewan Razib