JSON Formatter & Validator
Format, minify and validate JSON with clear error reporting. Useful for reading API responses, debugging configuration files, and checking that data is well-formed before sending it anywhere.
The errors behind almost every failure
JSON has a deliberately tiny specification, so nearly every parsing error comes from a short list. Trailing commas are the most common: a comma after the last item is valid JavaScript and invalid JSON. Single quotes are the next. JSON requires double quotes for both keys and string values, so { 'name': 'value' } fails despite being perfectly good JavaScript. Unquoted keys fail for the same underlying reason. Those last two share a root cause worth internalising: JSON looks like JavaScript object syntax but is a stricter, separate format. Anything copied out of code needs checking rather than assuming.
Reading the error position
Parsers report something like Unexpected token } at position 47 . Two things help. The position is where the parser noticed the problem, which is often just after where you made it — a missing comma on one line is typically reported at the start of the next. And "unexpected end of input" almost always means an unclosed bracket or brace. Formatting the document is the fastest way to find it, because proper indentation makes an unbalanced structure immediately visible.
What JSON does not support
JSON has strings, numbers, booleans, null, objects and arrays. It has no undefined , no NaN , no Infinity , no functions and — the practical one — no date type. Dates are conventionally stored as ISO 8601 strings such as "2026-08-19T10:30:00Z" . There is also no comment syntax. Neither // nor /* */ is permitted, which surprises people writing configuration files. The usual workaround is a throwaway key such as "_comment" .
Quick tips
- Format first — indentation alone reveals most structural problems.
- Escape backslashes in Windows paths: C:\\Users\\file, not C:\Users\file.
- Leading zeros are invalid in numbers; if they matter, it is a string.
- For a very large document, validate it in halves to narrow down the problem.
How does JSON validation detect errors?
The validator parses JSON using native browser engines and pinpoints exact syntax error details.