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
- Paste your JSON into the JSON Input panel.
- Read the Base64 string in the Base64 Output panel; it updates as you type.
- If an error message appears, fix the JSON syntax it points to.
- Select Copy Output to copy the encoded string.
- Press Clear All to encode something else.
Example input
{"name":"Auro","tools":["token-counter","json-formatter"]}Frequently asked questions
- Yes. Whitespace outside the strings is removed first, so the same data encodes to the same Base64 whether it was pretty-printed or on one line. Spaces inside string values are kept.
- The input has to be valid JSON, so single quotes, trailing commas, comments and unquoted keys are rejected. The message points to the character where the problem starts. Fix that spot and the output appears.
- Yes. The text is converted to UTF-8 bytes before encoding, so characters outside basic ASCII decode back to the same text with any UTF-8 aware decoder.
- Not on this page, which always produces the standard alphabet with padding. Swap plus for dash, slash for underscore and drop the equals signs, or use the Base64 encoder and tick its URL-safe option.
- No. Validation, minifying and encoding all run in your browser, and the page's usage events never include what you paste.
