Developer Tools
Five essential utilities for web developers — encode, hash, decode, and convert data without leaving your browser.
Encode and decode text or files to and from Base64 format.
How Base64 Works
Base64 encodes binary data as ASCII text using 64 printable characters (A–Z, a–z, 0–9, +, /). Every 3 bytes of input become 4 Base64 characters, making encoded output about 33% larger than the original. It is not encryption — anyone can decode it instantly.
The main use is transporting binary data through systems that only handle text — HTTP headers, JSON payloads, email (MIME), and HTML data URIs all use Base64 for this reason.
| Use case | Example |
|---|---|
| HTTP Basic Auth | Authorization: Basic dXNlcjpwYXNz (encodes user:pass) |
| Embed images in CSS/HTML | background: url("data:image/png;base64,iVBOR...") |
| JSON Web Tokens (JWT) | Each JWT section (header.payload.sig) is Base64url-encoded |
| Email attachments (MIME) | Binary files encoded as Base64 text in email body |
| Storing binary in databases | Store image/file bytes as Base64 text in a VARCHAR/TEXT column |
| Environment variables | Pass binary credentials (certs, keys) as Base64 strings |
Base64 vs Base64url
Standard Base64 uses + and / which are reserved characters in URLs. Base64url replaces them with - and _ and omits = padding. JWTs, OAuth tokens, and URL-safe cookies use Base64url. If you see a token with - instead of + it's Base64url.
Base64 in Code
// Encode
btoa('Hello World') // → 'SGVsbG8gV29ybGQ='
// Decode
atob('SGVsbG8gV29ybGQ=') // → 'Hello World'
// For binary/files use FileReader:
const reader = new FileReader();
reader.readAsDataURL(file); // returns base64 data URL// Encode
Buffer.from('Hello World').toString('base64')
// → 'SGVsbG8gV29ybGQ='
// Decode
Buffer.from('SGVsbG8gV29ybGQ=', 'base64').toString()
// → 'Hello World'import base64
# Encode
base64.b64encode(b'Hello World')
# → b'SGVsbG8gV29ybGQ='
# Decode
base64.b64decode('SGVsbG8gV29ybGQ=')
# → b'Hello World'// Encode
base64_encode('Hello World');
// → 'SGVsbG8gV29ybGQ='
// Decode
base64_decode('SGVsbG8gV29ybGQ=');
// → 'Hello World'All Developer Tools
Frequently Asked Questions
Common questions about Developer Tools