Base64 Encode/Decode โ Complete Guide with Free Tool
Base64 turns binary data into text. It's everywhere โ emails, APIs, data URIs, JWTs. Here's how it works.
What Is Base64?
Base64 encoding converts binary data into a string of 64 printable ASCII characters (A-Z, a-z, 0-9, +, /). The output is about 33% larger than the input but safe to transmit in text-only channels.
Encode/Decode Free
Use our Base64 Encoder/Decoder โ paste text to encode, or paste Base64 to decode. Supports URL-safe mode and file-to-Base64 conversion via drag & drop.
Where Base64 Is Used
- Email attachments โ MIME encoding for binary files
- Data URIs โ Embed images directly in HTML/CSS:
data:image/png;base64,... - API authentication โ HTTP Basic Auth uses Base64
- JWTs โ JSON Web Tokens are Base64url encoded
- Storing binary in JSON/XML โ Text-safe representation
Base64 vs URL-Safe Base64
Standard Base64 uses + and / which conflict with URLs. URL-safe Base64 replaces them with - and _ and removes trailing = padding.
In Code
- JavaScript:
btoa('hello')/atob('aGVsbG8=') - Python:
base64.b64encode(b'hello') - Bash:
echo -n 'hello' | base64