tools.now

JSON Formatter & Validator

Paste JSON to pretty-print it, minify it, or find out exactly where it is invalid. Parsing happens in your browser, so API responses and config files stay on your machine.

Output

🔒 Runs in your browser. Your data is never uploaded.

How to use

  1. Paste or type JSON into the input box.
  2. Pick an indent (2 spaces, 4 spaces, tab) or Minify. Optionally sort keys alphabetically.
  3. Copy the formatted result, or fix the error at the reported line and column.

Why valid-looking JSON fails

The most common causes are a trailing comma after the last item, single quotes instead of double quotes, unquoted property names, and comments. All four are legal in JavaScript object literals but not in JSON.

Large numbers

JSON numbers are parsed as 64-bit floats. Integers above 9,007,199,254,740,991 (2^53 − 1) lose precision when re-formatted; keep such IDs as strings.

Frequently asked questions

Is my JSON sent to a server?
No. Formatting and validation run entirely in your browser with JavaScript. You can disconnect from the internet and the tool still works.
What is the difference between formatting and validating?
Validating checks that the text is legal JSON. Formatting re-prints valid JSON with consistent indentation. This tool does both: invalid input shows an error with its line and column instead of output.
Does formatting change my data?
Only whitespace changes, unless you turn on Sort keys, which reorders object properties. Values are preserved, with the one exception of numbers too large for a 64-bit float.
Can it format JSON with comments or trailing commas?
No. Those are JSON5/JSONC features. Strict JSON, as used by APIs and JSON.parse, does not allow them, and the validator reports them as errors.

Related tools