Loading...
Loading...
Convert between plain text and Base64 in either direction. Handles full UTF-8, the URL-safe variant, and works entirely in your browser — no uploads, no tracking.
Live counts update as you type.
Base64 is a binary-to-text encoding that represents arbitrary bytes using a 64-character alphabet — uppercase A-Z, lowercase a-z, digits 0-9, plus `+` and `/`. It was designed for systems that only handle printable ASCII, so binary data like images, JSON tokens, or email attachments can travel through text-only channels unchanged. The output is about 33% larger than the input because every three bytes become four Base64 characters. This tool runs entirely in your browser using the standard `TextEncoder` / `atob` / `btoa` APIs, so nothing you paste leaves your device.
Choose encode to go from plain text to Base64, or decode to go from Base64 back to text.
Works with any UTF-8 text — emoji, non-Latin scripts, and multi-byte characters are all handled correctly.
Tick the URL-safe checkbox to use the base64url alphabet (`-` and `_` instead of `+` and `/`) with padding stripped. Required for JWT tokens and many web APIs.
Click copy to grab the output, or click swap direction to feed the result back into the input with the opposite mode.
Group the input into 3-byte blocks (24 bits each) Split each block into 4 groups of 6 bits Map each 6-bit value (0–63) to the Base64 alphabet Standard alphabet: A-Z a-z 0-9 + / URL-safe alphabet: A-Z a-z 0-9 - _ Pad the last block with = until length is a multiple of 4 Output length = ceil(input_bytes / 3) × 4
Because 3 bytes equal 24 bits and 4 Base64 characters carry 24 bits of information, the encoding is lossless and exactly reversible. When the input length is not a multiple of three, the encoder pads the final group with `=` characters so every valid Base64 string is a multiple of four characters. The URL-safe variant defined in RFC 4648 §5 swaps the two characters that are reserved in URLs (`+` becomes `-`, `/` becomes `_`) and typically drops the padding, producing a form that can be pasted into a URL or a JWT without percent-encoding.
Reference: RFC 4648 — The Base16, Base32, and Base64 Data Encodings
| Input | Output |
|---|---|
"Hello, world!" → encode | SGVsbG8sIHdvcmxkIQ== Standard alphabet with two `=` padding characters. |
"café ☕" → encode (UTF-8) | Y2Fmw6kg4piV Multi-byte characters are encoded as their UTF-8 bytes first. |
c3ViamVjdHM_Zm9vJmJhcj0x → decode URL-safe | subjects?foo&bar=1 URL-safe variant uses `_` instead of `/` and drops padding. |
aW52YWxpZA!!! → decode | Error `!` is not in the Base64 alphabet, so the tool reports an error. |
Format, validate, and minify JSON with precise error line and column reporting.
Split JSON Web Tokens into header, payload, and claims with readable expiry dates.
Convert between epoch numbers and dates with auto-detect for seconds vs milliseconds.
Calculate your exact age in years, months, and days from any date of birth.
Last updated