FormatterHQ

Base64 to JSON

Decode a Base64 or Base64URL string and see the JSON inside, pretty-printed and validated in one step.

Loading tool…
Ready.

How to use the Base64 to JSON

  1. Type or paste into the Base64 box, or click Sample. You can also drop a file on a box or use its Open file button.
  2. The JSON box updates live as you type. It works both ways — edit the JSON side to convert back, or click ⇄ Swap to exchange the sides.
  3. Alphabet and Wrap lines at 76 chars (MIME) in the options bar above the editors only affect the reverse direction — the Base64 output you get when you type in the JSON box.
  4. Use Copy or Download on either box to take the result, or Clear to start again.

Base64 to JSON decoder

The Base64 to JSON tool is built for the moment you find an opaque eyJ… string in a log, a cookie, a message queue or an API response and need to know what is inside. It decodes the Base64 (standard or URL-safe, with or without padding), parses the result as JSON and pretty-prints it with two-space indentation.

Example

Base64 input:

ewogICJpZCI6IDQyLAogICJuYW1lIjogIldpZGdldCIsCiAgInRhZ3MiOiBbIm5ldyIsICJzYWxlIl0KfQ==

Decoded JSON:

{
  "id": 42,
  "name": "Widget",
  "tags": [
    "new",
    "sale"
  ]
}

When the result is not valid JSON

The status bar tells you whether the decoded text is valid JSON. If it is not, you still see the decoded text along with the parser’s message, which usually points to one of these causes:

  • Truncation. The Base64 string was cut short, so the JSON ends mid-value. For example, a value ending in …aWRnZXQi decodes to {"id":42,"name":"Widget" — valid so far, but missing the closing brace.
  • It is not JSON. The data could be plain text, XML, a serialized object or binary data. Binary output is shown as a hex dump with a download option.
  • Extra layers. Some systems compress before encoding. Base64 starting with H4sI is gzip; decompress it with Gzip Decompress first.

JWTs and other tokens

A JSON Web Token contains two Base64URL JSON segments separated by dots. You can paste one segment here, but the JWT Decoder handles the whole token and also converts expiry timestamps into dates. Keep in mind that decoding a token does not verify its signature.

Decoding in code

JSON.parse(atob(s)) works only for ASCII content and standard Base64. For UTF-8 text and Base64URL, use JSON.parse(Buffer.from(s, 'base64url').toString()) in Node.js, or json.loads(base64.urlsafe_b64decode(s + "==")) in Python (the extra padding is tolerated). This tool handles all of those cases without code.

Common places to find Base64 JSON

  • Kubernetes secrets such as .dockerconfigjson.
  • Cloud provider event payloads and message attributes.
  • Session cookies and state parameters in web frameworks.
  • Configuration exported by CI/CD systems.

Once decoded, you can edit the JSON and re-encode it with JSON to Base64. Decoding runs locally, but treat tokens and session cookies as sensitive: they may grant access to an account.

Recognizing Base64 JSON by its first characters

Because Base64 encodes three bytes at a time, the same opening characters always produce the same prefix. Learning a few of them lets you guess what a string contains before decoding it:

Base64 starts withDecoded text starts with
eyJ{" followed by a letter, a compact JSON object (and every JWT segment)
W3si[{", an array of objects
ewog{ plus a newline, pretty-printed JSON
H4sInot JSON yet: gzip-compressed data that must be decompressed first

If a string starts with something else entirely, it may use a different encoding or be encrypted, and decoding it will only produce unreadable bytes.

Frequently asked questions

Can it decode Base64URL without padding?
Yes. URL-safe characters are converted and missing = padding is added automatically, so JWT segments and similar tokens decode directly.
Why is the decoded JSON reported as invalid?
The Base64 may be truncated, the content may not be JSON, or it may be compressed. The decoded text is still shown so you can see what went wrong.
Does it change the JSON?
Valid JSON is parsed and written out again with two-space indentation. String keys and values keep their order, but as in JavaScript, whole-number keys move to the front, a repeated key keeps only its last value, and numbers are normalised: 1.0 becomes 1 and integers beyond 2^53 lose precision.
Can I decode a whole JWT here?
Paste one segment at a time, or use the JWT Decoder, which splits the token and decodes header and payload together.

Last updated October 3, 2026

Related tools