Encode text to Base64, decode Base64 strings, convert files and images to data URIs, and inspect JWT tokens. Runs entirely in your browser β no data sent to servers.
Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable ASCII characters: AβZ (26), aβz (26), 0β9 (10), and + and / (2), plus = for padding. It was designed to safely transmit binary data over channels that were designed to handle only text β such as email protocols and HTTP headers.
Base64 increases the size of data by approximately 33% (every 3 bytes of binary become 4 ASCII characters). This trade-off is worthwhile when the channel cannot handle arbitrary binary data. Modern web development uses Base64 extensively for embedding images in HTML/CSS, encoding credentials, and serializing binary data in JSON.
| Feature | Standard Base64 | Base64URL |
|---|---|---|
| Characters 62β63 | + and / | - and _ |
| Padding | Uses = padding | Padding often omitted |
| URL safe? | β + and / need encoding | β Safe in URLs |
| Used in | Email (MIME), data URIs | JWT, OAuth tokens, URL params |
The URL-safe variant replaces + with - and / with _. This prevents issues when Base64 data appears in URLs or HTTP headers where + is interpreted as a space and / is a path separator.
The HTTP Authorization header for Basic auth is constructed as Authorization: Basic [base64(username:password)]. The credentials are Base64-encoded (not encrypted β always use HTTPS). This tool lets you inspect what's inside such headers.
Data URIs embed file content directly in HTML or CSS: src="data:image/png;base64,[data]". This eliminates an HTTP request for small icons but increases HTML size. Suitable for small images, not large ones.
JWTs consist of three Base64URL-encoded segments separated by dots: Header.Payload.Signature. The header and payload are readable JSON; the signature is a cryptographic hash. This tool's JWT Inspector decodes the header and payload for debugging.
Some APIs accept binary file uploads as Base64-encoded strings within JSON bodies. This avoids multipart form encoding complexity and allows file data to be included alongside other JSON fields in a single request.
Email protocols (SMTP) handle text. Attachments are encoded as Base64 within MIME multipart messages so that binary files (PDFs, images, etc.) can be safely transmitted over text-based mail servers.
A JSON Web Token (JWT) is a compact, URL-safe way to represent claims between two parties. It is widely used for authentication (login sessions) and authorization (API access control). The token's three parts are:
sub (subject), exp (expiration), iat (issued at), plus any custom application dataImportant: The header and payload are only Base64-encoded β they are NOT encrypted or hidden. Anyone who has the token can read the payload. Never store sensitive data (passwords, credit card numbers) in JWT payloads.