JSON Formatting and Validation

Formatting makes JSON easier to scan, but it cannot replace finding and fixing a syntax error. This guide shows which step to take first and what each check actually proves.

Formatting, syntax checks, and schema checks answer different questions

Formatting parses input it can already read and prints it again with indentation. Syntax validation asks whether the text follows JSON grammar. Schema validation checks separate data rules, such as required fields, value types, or an API contract.

For example, {"age":"unknown"} is valid JSON syntax, but an application expecting a numeric age can still reject it. Neither a formatted result nor a syntax pass proves that the data meets those rules.

Enough JSON grammar to spot common mistakes

Objects contain name–value pairs in braces; arrays contain values in brackets. Property names and strings need double quotes. A colon separates a name from its value, and commas separate entries. Numbers, true, false, and null are also values.

Standard JSON has no comments or trailing commas, and single quotes cannot delimit strings. A JavaScript object literal pasted into a JSON field often fails for one of these reasons.

Trailing comma

Incorrect

{"name":"Utilook",}

Corrected

{"name":"Utilook"}

Single quotes

Incorrect

{'name':'Utilook'}

Corrected

{"name":"Utilook"}

A practical order for fixing an error

The reported position is where the parser noticed a problem, not necessarily where the mistake began. A missing comma or bracket may only become obvious at the next token.

  1. Check syntax with JSON Validator first.
  2. If it shows a line and column, inspect that character and the quote, comma, or bracket just before it. Otherwise use the parser message to inspect the surrounding structure.
  3. Correct the syntax and check again. Once it passes, use JSON Formatter to reveal nested structure.
  4. If your application requires particular fields or types, run a separate JSON Schema or application-level check.

Utilook's tools use different parsers and processing locations

JSON Validator runs JSON.parse in your browser. It does not send your JSON to the server. After a successful check, it sends only a tool-use count request without the input.

JSON Formatter sends the input to the Utilook server, where it is parsed and printed with two- or four-space indentation. This feature does not save the input or result to a database, but you should consider that server transfer before submitting sensitive content. Optional key sorting changes object-key order, and re-serialization can alter the original notation.

The Formatter's current server parser also accepts NaN and Infinity. These are not JSON values under RFC 8259. If the result must work in another system, checking standard syntax with the browser Validator first is the safer order.

Put it into practice

References