Base64 encoder and decoder
Encode or decode Base64 and base64url, for text or whole files. Decode a JWT, flip URL and HTML escapes, or generate a hash. Everything runs on this page, nothing is uploaded.
UTF-8 safe. Emoji, accents and every script round trip correctly, because this reads your text as bytes first instead of handing it straight to the browser's built in encoder, which only understands Latin-1 and breaks on anything above it.
Pick any file. It is read in your browser only, nothing is uploaded.
Base64 or data URI back to a file
This decodes the token and reads what is inside it. It does not check the signature. Checking a signature needs the secret or private key, and doing that in a browser page would prove nothing since anyone could fake the page. Nothing you paste here leaves this tab, there is no server behind this tool.
Header
Payload
Escapes every character that is not a letter, digit or one of - _ . ~, including / and &. Use this on one value that is going inside a query string, never on a whole URL, or it mangles the slashes too.
Leaves URL structure characters like : / ? & = # alone and only escapes spaces and anything that is not valid in a URL at all. Use this on a whole URL, not on a single value.
Build a query string
Parse a query string
| Key | Value |
|---|---|
| Nothing parsed yet. | |
Named escapes the five markup characters as & < > " and a numeric reference for the apostrophe, since not every parser accepts the named one. Numeric escapes those same five plus anything outside the printable ASCII range, as &#NNNN;, which is the safest form to paste into an old system. Decode reads back every named and numeric reference your browser knows, including ones typed as hex.
| Algorithm | Hash | |
|---|---|---|
| MD5 | not calculated | |
| SHA-1 | not calculated | |
| SHA-256 | not calculated | |
| SHA-384 | not calculated | |
| SHA-512 | not calculated |
MD5 and SHA-1 are broken for security. Do not use either one to protect a password, sign anything, or prove a file has not been tampered with by someone who knows what they are doing. They are still fine as a plain checksum, to check a download did not get corrupted in transit.
How Base64 encoding works
Base64 turns any bytes, text, an image, a whole file, into a string made only of letters, digits, +, / and padding =, so it can travel safely through places that only trust plain text, like JSON, a URL, or an email. It works by grouping the data into chunks of 3 bytes (24 bits) and re splitting those 24 bits into four 6 bit pieces, each one mapped to one of 64 safe characters. That is also why the output is always about a third longer than the input, 3 bytes in becomes 4 characters out.
The most common way this breaks is text. The browser's built in btoa and atob only understand Latin-1, one byte per character, so the moment your text has an emoji, a flag, Bangla, Arabic or almost any script outside basic Western European letters, btoa throws an error or silently mangles it. This tool reads your text as UTF-8 bytes first with TextEncoder, encodes those bytes, and reverses the same two steps to decode, so every script and every emoji round trips exactly.
Base64url is the same idea with two characters swapped so the result is safe to put straight into a URL or a filename without further escaping: + becomes -, / becomes _, and the trailing = padding is dropped entirely since the length alone is enough to decode it. JSON Web Tokens use base64url for exactly this reason, which is why pasting a real token into a plain Base64 decoder usually fails partway through.
Related tools
Everything here runs in your browser. Nothing you type, paste or upload is sent anywhere or stored.