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 caseExample
HTTP Basic AuthAuthorization: Basic dXNlcjpwYXNz (encodes user:pass)
Embed images in CSS/HTMLbackground: 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 databasesStore image/file bytes as Base64 text in a VARCHAR/TEXT column
Environment variablesPass 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

JavaScript (browser)
// 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
Node.js
// Encode
Buffer.from('Hello World').toString('base64')
// → 'SGVsbG8gV29ybGQ='

// Decode
Buffer.from('SGVsbG8gV29ybGQ=', 'base64').toString()
// → 'Hello World'
Python
import base64

# Encode
base64.b64encode(b'Hello World')
# → b'SGVsbG8gV29ybGQ='

# Decode
base64.b64decode('SGVsbG8gV29ybGQ=')
# → b'Hello World'
PHP
// Encode
base64_encode('Hello World');
// → 'SGVsbG8gV29ybGQ='

// Decode
base64_decode('SGVsbG8gV29ybGQ=');
// → 'Hello World'

All Developer Tools

and you render it as-is, the browser executes it. Encoding converts < to < so it renders as visible text. React JSX does this automatically — but dangerouslySetInnerHTML bypasses it, so always sanitize input there."}},{"@type":"Question","name":"What is the difference between Base64 and Base64url?","acceptedAnswer":{"@type":"Answer","text":"Standard Base64 uses + and / which are special characters in URLs. Base64url replaces + with - and / with _, and removes = padding. JWTs, OAuth tokens, and URL-safe cookies all use Base64url to avoid encoding issues when tokens appear in URLs or HTTP headers."}}]}

Frequently Asked Questions

Common questions about Developer Tools