Encode JSON to Base64

Encode a JSON object to Base64 for headers, query strings and config values. Paste JSON and copy the encoded string. Free and local.

Part of the free Base64 Encoder. Runs in your browser — nothing is uploaded.

Encode JSON to Base64

Some systems expect JSON passed as a single Base64 string, for example in HTTP headers, environment variables and message attributes. Minify your JSON first, then encode it for the smallest result.

Worked example: A compact JSON object

JSON

{"userId":42,"role":"admin"}

Base64

eyJ1c2VySWQiOjQyLCJyb2xlIjoiYWRtaW4ifQ==

Practical tip

Minify JSON before encoding. Whitespace adds bytes, and Base64 makes every byte count by 33%.

How to use this Base64 Encoder

  1. 1Use the live tool above — it runs entirely in your browser and never uploads your data.
  2. 2Paste the sample from the worked example, or use your own input.
  3. 3Copy the result, then adapt the same steps in your editor, script, or pipeline.

Encode JSON to Base64 FAQs

How do I decode the Base64 back to JSON?

Use the Base64 decoder, then paste the result into a JSON formatter to make it readable again.

Should I put secrets in Base64-encoded JSON?

No. Base64 hides nothing. Anyone can decode it, so encrypt sensitive data separately.

More Base64 Encoder pages

Open the full Base64 Encoder tool →