Base64 ↔ JSON

Decode Base64-encoded JSON (including JWT payloads) or encode JSON for transport. Auto-detects URL-safe variants.

MODE
BASE64 INPUTstandard or URL-safe
DECODED JSON
// decoded JSON appears here

Why JSON travels as Base64

Base64 turns arbitrary bytes into a string of 64 printable ASCII characters. Three input bytes become four output characters, which is why Base64 inflates the payload by 33%. The trade-off buys you transport through channels that mangle or reject special characters.

The most common case is JWTs: the header and payload are both Base64URL-encoded JSON, joined with dots and signed. URL-safe Base64 (with - and _ instead of + and /, no padding) avoids the characters that mean something special in URLs.

JWT payloads

A JWT looks like xxx.yyy.zzz — three Base64URL parts. The middle part is the JSON claims. Paste just that segment to inspect what a token carries before trusting any signature.

Privacy first

Both encode and decode use the browser's native atob/btoa wrapped with proper UTF-8 handling. Nothing leaves your tab.

Common questions

What is Base64 and why is JSON often Base64-encoded?
Base64 is a binary-to-text encoding that represents arbitrary bytes using only 64 printable ASCII characters (A-Z, a-z, 0-9, +, /). JSON gets Base64-encoded when it has to travel through a text-only channel that does not tolerate the original characters: JWT payload, URL fragment, environment variable, HTTP basic auth header, email attachment.
What is the difference between Base64 and Base64URL?
Base64URL replaces + with -, / with _, and drops the trailing = padding. It is what JWTs and most URL-safe encodings use. This tool auto-detects both formats on decode and lets you pick the variant on encode.
My JWT decoded but the result is gibberish — why?
A JWT has three parts separated by dots. The middle part is the Base64URL-encoded payload — that is what you want to decode. The first part is the header and the third is the signature (binary, will not decode to readable JSON). Paste just the middle segment.
How big a payload can I decode?
Practically unlimited. Both encode and decode run in linear time and constant memory per byte. Multi-megabyte payloads decode in milliseconds.
Is the decoded JSON validated?
After Base64 decoding the tool runs JSON.parse on the result. If it parses, the formatted output is shown. If it does not (the Base64 contained something other than JSON), the raw decoded text is shown with a notice.
Is my data private?
Yes. Both Base64 transcoding and JSON parsing happen locally in your browser. No network calls during conversion — you can decode JWTs from production without leaking anything.