Skip to content

JSON to Base64

Encode JSON as Base64.

Loading…

About JSON to Base64

Putting JSON in an environment variable, a header or a single-line config field usually means Base64. Paste the JSON and the encoded string appears as you type. The JSON is validated and stripped of whitespace before encoding, so indentation changes never alter the result, and invalid JSON is rejected rather than encoded. The text is encoded as UTF-8, which keeps accented letters and symbols intact.

Features

  • Validates the JSON before encoding it
  • Strips whitespace first, so formatting never changes the output
  • UTF-8 encoding keeps accented letters and symbols intact
  • Standard Base64 alphabet with equals-sign padding
  • Output updates as you type

Limitations

  • Output uses the standard alphabet with plus and slash characters. There is no URL-safe switch on this page; the Base64 encoder offers one.
  • Invalid JSON is never encoded, so text that is not JSON needs the Base64 encoder instead.
  • Decoding the result returns the minified JSON, not your original layout, and JSON nested more than 1,000 levels deep is refused.

How it works

  1. Paste your JSON into the JSON Input panel.
  2. Read the Base64 string in the Base64 Output panel; it updates as you type.
  3. If an error message appears, fix the JSON syntax it points to.
  4. Select Copy Output to copy the encoded string.
  5. Press Clear All to encode something else.

Example input

{"name":"Auro","tools":["token-counter","json-formatter"]}

Frequently asked questions