Base64 to JSON Decoder
Decode Base64-encoded strings to readable, formatted JSON
Base64 Input
Decoded JSON
What Is Base64 to JSON Decoding?
Base64 is a binary-to-text encoding scheme defined in RFC 4648 that represents binary data using 64 printable ASCII characters. It is widely used to transmit data in contexts where binary data is not safe — such as HTTP headers, JWT tokens, email attachments, and data URIs. When a JSON payload is Base64-encoded, it must be decoded before it can be read or used.
This tool decodes the string with the browser's built-in atob(), reads the bytes as UTF-8 (so München stays München), then parses the result as JSON and pretty-prints it with 2-space indentation. Large integers such as 8901240544102066246 keep every digit instead of being rounded the way plain JSON.parse() would. If the decoded text isn't JSON, you get the raw text instead, with a note saying so.
How to Decode Base64 to JSON
Follow these steps to decode your Base64 string.
Paste the Base64 string
Paste your Base64-encoded string into the input panel, or click Sample to load a JWT-style payload for customer Ava Chen. Whitespace and newlines are stripped before decoding, a data:...;base64, prefix is removed, and Base64URL (with - and _, padding optional) works as-is.
Instant decode and format
The output updates as you type. Valid JSON is pretty-printed with 2-space indentation. If the Base64 itself is broken you get a short error; if it decodes to something that isn't JSON (plain text, XML, CSV), you see the decoded text with a note.
Copy the JSON
Click Copy to copy the formatted JSON to your clipboard. When the result wasn't JSON, Copy gives you the raw decoded text without the note.
Common Use Cases
JWT Token Inspection
JSON Web Tokens (JWT) are three Base64URL-encoded parts separated by dots. Copy the middle part (the payload) and paste it here to read the claims, like sub, exp and role. Remember this only decodes; it doesn't verify the signature, so don't treat what you see as trusted.
API Response Debugging
Some REST APIs return their response body Base64-encoded — either as a design choice or because the payload contains binary data. Decode the body here to inspect the JSON payload.
Configuration Decoding
Kubernetes secrets, CI/CD pipeline variables and environment configs are often stored as Base64. Paste the value of a data: field from kubectl get secret -o yaml and you'll see the JSON config inside, if that's what it holds.
Email & Messaging Payloads
Webhook payloads delivered via email or messaging queues (e.g., AWS SQS, SNS) are sometimes Base64-encoded. Decode them here to inspect the original JSON event structure.
Frequently Asked Questions
Standard Base64 versus Base64URL: how do they differ?
Standard Base64 uses + and / as the 62nd and 63rd characters and usually ends with = padding. Base64URL swaps those for - and _ and often drops the padding, which makes it safe in URLs and headers. This tool accepts both: it maps -/_ back and re-adds the padding before decoding.
What if the decoded result is not valid JSON?
You see the raw decoded text with a note that it isn't valid JSON, and Copy gives you that text. This happens when the Base64 holds plain text, a different format such as XML or CSV, or JSON that was truncated before it was encoded.
Why does it say the input isn't valid Base64?
The browser's atob() throws an InvalidCharacterError when the input contains characters outside the Base64 alphabet. Common causes: surrounding text copied by accident (quotes, a field name, a trailing period), or a whole JWT pasted with its dots. For a JWT, paste just one segment. Base64URL characters and missing padding are handled for you.
Is my data sent to any server?
No. All decoding and formatting happens entirely in your browser using the built-in atob() function. No data is transmitted anywhere.
How do I encode JSON to Base64?
Use the JSON to Base64 tool. It UTF-8 encodes your JSON before running btoa(), so emoji and accented characters encode correctly.
Related Tools
Explore more encoding, decoding, and JSON utilities.