jsonecho

JSON to Base64

Validate JSON and encode it to Base64 in one step.

Loading the tool...

How to use JSON to Base64

  1. Paste your JSON.
  2. Tick URL-safe if you need it for a token or a URL.
  3. Copy the Base64 string.

About JSON to Base64

JSON travels in Base64 when it has to fit into a header, a cookie, a URL or a field that does not accept quotes and braces. JWT tokens are the best-known example: the header and the payload are JSON documents encoded as URL-safe Base64.

The JSON is checked for syntax errors before it is encoded, so you do not end up with a perfectly encoded document that nobody can read. It is also minified first, which keeps the Base64 string short.

Frequently asked questions

Does the encoding change my JSON?

It is minified, which only removes whitespace. The data is identical after decoding.

Is this secure?

No. Base64 is an encoding, not encryption, and anybody can reverse it. Do not rely on it to protect secrets.

How do I turn it back?

Use the Base64 to JSON tool, which decodes the string and formats the JSON.

Why URL-safe?

Standard Base64 contains + and / which have special meanings in URLs. URL-safe replaces them with - and _.

More in URL and Base64

All tools →