Base64 to JSON
Decode Base64 or Base64URL to JSON with auto-formatting or minification. Supports JWT payload segments, API responses, and config objects — instantly detects valid JSON.
Decoded Output
Decoding a JWT? Use the dedicated JWT Decoder
The JWT Decoder supports the full header.payload.signature format — parse both Header and Payload in one step, and see exp claims and expiry time.
How Decoding Works
- 1
Strip prefix
If the input is a Data URL (data:…;base64,…), the prefix is stripped automatically, leaving only the data segment.
- 2
Detect Base64URL
Checks for - or _ characters (Base64URL format), converts to standard Base64, and adds missing = padding.
- 3
Base64 decode
Decodes to a binary byte sequence using atob().
- 4
UTF-8 conversion
Converts the byte sequence to a UTF-8 string using TextDecoder, correctly handling multi-language characters.
- 5
JSON parse
Attempts JSON.parse(). On success, provides formatted and minified output. On failure, shows raw text and marks it as 'not JSON'.
Base64 vs Base64URL
| Feature | Base64 | Base64URL |
|---|---|---|
| Charset | A–Z a–z 0–9 + / | A–Z a–z 0–9 - _ |
| Padding | Trailing = | Usually omitted |
| URL Safe | No (+ and / need escaping) | Yes (URL-safe) |
| Common Use | HTML, JSON, API Body | JWT, URL params, Cookie |
| Example | SGVsbG8= | SGVsbG8 |
Frequently Asked Questions
How do I decode a JWT Payload?
A JWT has the format header.payload.signature, three segments separated by dots. Copy only the middle payload segment (between the two dots) and paste it into this tool. It will auto-detect Base64URL and decode to readable JSON. To also parse the header and verify the signature, use the JWT Decoder page.
What is the difference between Base64 and Base64URL, and do they decode the same way?
Base64URL replaces + with - and / with _, and removes trailing = padding, making it safe for use in URLs and HTTP headers. This tool auto-detects - or _ characters and converts to standard Base64 before decoding — no manual handling required.
What does 'not JSON format' mean after decoding?
It means Base64 was decoded successfully, but the resulting text could not be parsed by JSON.parse(). Possible reasons: the original data is plain text (e.g. "Hello, World!"), HTML, binary, or another non-JSON format. Switch to the Decoded Text tab to see the raw decoded content.
What is the difference between Formatted JSON and Minified JSON?
Formatted JSON uses 2-space indentation for human-readable output, useful for debugging. Minified JSON strips all unnecessary whitespace and newlines for the smallest file size — suitable for programmatic processing or re-encoding as Base64. Both contain exactly the same data.
Does the decoded JSON go through a server?
No. All decoding runs locally in your browser using the atob() and TextDecoder APIs — data is never uploaded to any server. Safe for decoding JWTs or config data containing sensitive information.
What should I do if decoding fails?
First confirm the string only contains valid Base64 characters (A–Z, a–z, 0–9, +, /, =) or Base64URL characters (A–Z, a–z, 0–9, -, _). If copied from a JWT, make sure you copied only one of the three segments, without any dot separators. Use the Base64 Validator to diagnose further.