$ encode --base64

base64 encoder / decoder.

Encode text or files to Base64, decode Base64 back to text, and download binary output. 100% client-side.

input
1
2
3
4
5
0 / ∞ chars

upload a file to encode

output
Base64 encodes binary data into text format for safe transmission over text-based protocols like HTTP, email attachments, and data URIs in HTML/CSS.
No, Base64 is an encoding scheme, not encryption. Anyone can decode Base64 instantly. Never use it to protect sensitive data.
Yes, Base64 increases size by about 33%. For large files, consider sending binary directly or using compression before encoding.

How Base64 Works

Base64 converts binary data to 64 ASCII characters: A-Z, a-z, 0-9, +, and / (with = as padding). Every 3 bytes of input become 4 characters of output — that's why Base64 increases size by ~33%.

Common Use Cases

Use CaseWhy Base64?Example
Data URIsEmbed images directly in HTML/CSSdata:image/png;base64,iVBOR...
Email attachmentsSMTP is text-only protocolMIME multipart encoding
JWT tokensURL-safe header/payload encodingeyJhbGci...
API auth headersHTTP Basic AuthenticationAuthorization: Basic dXNlcjpwYXNz
JSON embeddingBinary data in JSON responses{"image": "data:image/..."}

Base64 vs Base64URL

Standard Base64:  ABCDefgh+/==
Base64URL:        ABCDefgh-_     (no padding, URL-safe chars)

Base64URL replaces +-, /_, and removes = padding. Use it in URLs and filenames.

learn more in our detailed guide.

→ read the guide