Logo JSON Parser Online

Encode and Decode JSON with Base64

Paste JSON and click Encode JSON to get a Base64 string, or paste a Base64 string and click Decode Base64 to recover the original JSON. Useful for transporting JSON in environments that require plain text — query parameters, HTTP headers, config files, or JWT payloads.

All JSON Tools

28 tools

Free, fast, runs in your browser. No login needed.

Made with ❤️ in India · © 2025 parsejsononline.com
INPUT
1
OUTPUT
1
✅ Ready
Characters: 0
Ctrl+Enter to run
What is this tool?

How to use

  1. To encode: paste JSON into the INPUT pane and click Encode JSON.
  2. To decode: paste a Base64 string into the INPUT pane and click Decode Base64.
  3. The output is either the Base64 string or the pretty-printed JSON.

How it works

Encoding first validates that your input is valid JSON, then runs btoa(input) to produce a standard Base64 string. The input JSON is encoded as-is, including any whitespace — so formatted and minified JSON will produce different Base64 strings even if they represent the same data. Minify first if you want a compact Base64 output.

Decoding runs atob(input) to recover the JSON string, then parses and re-formats it with 2-space indentation via JSON.parse() + JSON.stringify().

Standard Base64 only. The tool uses the browser's native btoa()/atob(), which work with the standard Base64 alphabet (A–Z, a–z, 0–9, +, /). It does not handle Base64URL encoding, which replaces + with - and / with _ and omits padding. If you have a Base64URL-encoded string (common in JWTs), replace - with + and _ with / before decoding, and add = padding to make the length a multiple of 4.

Common use cases: embedding JSON in a URL query parameter; storing JSON config in a Base64-encoded environment variable; inspecting Base64-encoded payloads in API responses or JWT claims.

FAQ

Does encoding change the JSON data?

No. The Base64 encoding is applied to the raw JSON string. The data is identical when decoded. However, whitespace from the original input is preserved in the encoded form — different formatting of the same JSON will produce different Base64 strings.

Why does my Base64 string fail to decode?

The most common cause is Base64URL encoding. JWT and URL-safe Base64 strings use - instead of + and _ instead of /. Replace those characters and add = padding before decoding. The tool uses standard Base64 (btoa/atob), not Base64URL.

Can I decode a JWT payload here?

You can decode the Base64 payload segment, but you will need to handle Base64URL normalization manually (replace - with + and _ with /). For full JWT decoding including header inspection and expiry status, use the JWT Decoder tool on this site.

Is my data sent anywhere?

No. Encoding and decoding run entirely in your browser.

Related tools

JWT DecoderDecode the Base64URL-encoded JWT header and payload. JSON EscapeEscape JSON strings for embedding in other contexts. JSON FormatterMinify JSON before encoding to reduce Base64 size.