Base64 Encoder & Decoder
Encode text to Base64 or decode Base64 back to plain text — all in your browser, nothing sent to a server.
Frequently Asked Questions
+ and /, which have special meanings in URLs. URL-safe Base64 replaces + with - and / with _, and strips padding = signs. It is used in JWT tokens and OAuth parameters.How Base64 Encoding Works
Base64 converts arbitrary binary data into a stream of printable ASCII characters using a 64-character alphabet.
Group Bytes
The input is read as raw bytes and grouped into chunks of 3 bytes (24 bits). Each group is split into four 6-bit values.
Map to Characters
Each 6-bit value (0–63) maps to a character in the Base64 alphabet: A–Z (0–25), a–z (26–51), 0–9 (52–61), + (62), / (63).
Pad Output
If the input length isn't divisible by 3, padding characters (=) are added to make the output a multiple of 4 characters. URL-safe mode replaces + with - and / with _.
Common Use Cases
HTTP Basic Authentication
The Authorization: Basic header encodes username:password as Base64. Paste the header value here to decode credentials during API debugging (over HTTPS only).
Data URIs
Small images, fonts, and SVGs are embedded directly in HTML/CSS as Base64 data URIs (data:image/png;base64,…), eliminating extra HTTP requests for small assets.
JWT Token Inspection
JSON Web Tokens are Base64URL-encoded. Paste the second segment (payload) to decode it and read the claims — useful for debugging auth flows without a dedicated JWT tool.
Email MIME Attachments
Email attachments in MIME format are Base64-encoded to transport binary files as text. If you've ever seen long strings in raw email source, they're often Base64-encoded file data.
Binary Data in JSON APIs
JSON has no native binary type. Base64 is the standard workaround: images, PDFs, and byte arrays are serialized as Base64 strings before being sent in JSON request or response bodies.
Cryptographic Key Transport
PEM-formatted certificates and private keys are Base64-encoded DER structures wrapped in -----BEGIN…----- headers. Understanding the encoding helps when working with TLS/SSL certificates.