Paste JSON to check that it is valid, pretty-print it with 2 or 4 spaces, or minify it to a single line. Everything runs in your browser; nothing is uploaded.
How to use
- Paste your JSON into the JSON input box.
- Choose Format (2 spaces), Format (4 spaces), Minify or Validate.
- If the JSON parses, you see “Valid JSON.” and the output box. If not, you see the parser’s error message (for example an unexpected token and its position), so you can find the problem.
What “valid” means here
The tool uses your browser’s built-in JSON.parse, which follows the JSON standard strictly. Common reasons for an error:
- Trailing commas after the last item in an object or array.
- Single quotes instead of double quotes around keys or strings.
- Comments (
//or/* */), which JSON does not allow. - Unquoted keys,
NaN,undefinedor other JavaScript-only values.
Formatting re-serialises the parsed data, so key order is kept but whitespace is normalised. Very large numbers beyond JavaScript’s safe integer range can lose precision.
Typical uses
Checking an API response, tidying a config file, or validating structured output from an AI model before you use it in code. For newline-delimited files, use the JSONL validator; to describe the shape of your data, try the JSON schema generator.
Related
JSON to CSV · CSV to JSON · YAML to JSON · JSONL validator · All tools
How we check
The behaviour described on this page was checked against the tool’s source code on 2026-11-19 (Asia/Colombo). Spotted a mistake? Contact us.