Format and validate JSON online
Minified or messy JSON from an API response or log file is hard to read. Paste it here and this tool instantly formats it with consistent indentation, or tells you exactly what's wrong if it isn't valid JSON. Everything runs in your browser using the native JSON parser — nothing you paste is sent anywhere.
Formatting and validating are the same operation
To indent JSON, the text has to be parsed into a structure first — and parsing is exactly what validation is. That is why this tool does both at once: if it can format your input, the input is valid JSON, and if it cannot, you get the parser's own error message telling you where it gave up. There is no separate validate button because there does not need to be one.
Reading the error message
JavaScript's parser reports a character position with its error, which points at where parsing failed rather than where the mistake is. A missing comma on line 4 usually surfaces as an error at the start of line 5, because that is where the parser encountered something unexpected. When the position looks wrong, check the line above. The most common causes by far are trailing commas after the last item, single quotes instead of double, and unquoted keys — all valid in JavaScript object literals but not in JSON.
Valid is not the same as correct
This checks syntax, not meaning. JSON can be perfectly well-formed while having the wrong field names, missing required properties, or values of the wrong type for whatever will consume it. Validating against a JSON Schema is a different and heavier process. If an API rejects a payload this tool says is valid, the problem is almost certainly the shape of your data rather than its syntax.
Frequently asked questions
- What happens if my JSON is invalid?
- The tool shows the parser's error message so you can find the problem, instead of just failing silently.
- Is my data sent anywhere?
- No, formatting happens locally in your browser using JavaScript's built-in JSON parser. Nothing is transmitted.
- Can I format very large JSON files?
- Yes, though very large payloads (multiple MB) may take a moment since parsing happens on your device.
- Does this validate JSON Schema too?
- No, this checks that your text is syntactically valid JSON, not that it matches a particular schema.
- Why does my JSON fail when it works in JavaScript?
- JavaScript object literals allow trailing commas, single quotes, and unquoted keys. JSON allows none of those — it is a stricter format that happens to look similar.