Data & Tables · PRACTICAL GUIDE
JSON syntax, formatting and common errors
Distinguish syntax validity, pretty-printing, duplicate keys and application-level validation.
Formatting changes layout, not meaning
JSON represents strings, numbers, booleans, null, arrays and objects. Indentation is not required. Pretty-printing adds whitespace between structural tokens; minification removes that whitespace. Spaces inside quoted strings remain data and must not be collapsed.
UtilityPilot keeps raw string and number tokens while changing structural whitespace. That avoids a parse-to-floating-point step that could round a long numeric identifier.
Common syntax failures
{"name":"Ada","active":true}This is valid. A comma after true is not. Single quotes around name are not JSON string syntax. Comments and undefined are also not permitted. A reported line and column points near the unexpected token; inspect the preceding punctuation as well.
A missing quote can make the parser appear to fail much later, because later text was interpreted as part of the string.
Duplicate keys and long numbers
{"id":1,"id":2}
{"id":9007199254740993}The first example is rejected here because duplicate-key handling differs between consumers. The second is formatted without altering its number spelling. Some applications will still round that number when reading it, so use a quoted identifier when the data contract allows one.
Syntax is only the first check
A JSON object can be syntactically valid and still fail an API because a required field is missing or has the wrong type. This formatter does not validate an application schema. It also rejects input above 5 MiB or nesting deeper than 50 levels to bound processing.
For CSV-to-JSON conversion, keep strings unless the destination explicitly expects typed values. Then compare the output against that destination’s documented contract.
When not to trust a formatter
A formatter that “succeeds” only proves supported JSON syntax. It does not prove the document is the one your API expects, that required fields are present, that types match a schema or that numbers will survive the consumer’s parser. Do not use formatting as a substitute for schema validation or contract tests.
Also do not use a formatter to “repair” JSON that is actually JSON5, YAML or a JavaScript object literal with unquoted keys. Those need the correct parser—see JSON / YAML Converter for configuration files with comments.
Common post-format mistakes
Minifying before hashing or signing changes the byte string if the original had different whitespace—hash the exact bytes the system will receive. Pretty-printing into a configuration file that expects compact JSON can break strict consumers. Copying a formatted document through a chat app can convert quotes to “smart quotes” and break it again.
After formatting, re-parse the result once. If you edited the pretty-printed output by hand, validate again before use. Keep the original response beside the formatted copy until the consumer accepts the new one.
A debugging workflow for bad responses
1) Confirm you are looking at JSON and not an HTML error page (check the first non-whitespace character). 2) Format and note the exact line/column of any error. 3) Inspect the preceding punctuation—missing commas often surface at the next key. 4) Check for duplicate keys and long numeric identifiers. 5) If the shape looks wrong but syntax is valid, validate against the API’s documented schema elsewhere; this tool will not do that. 6) Only then extract fields or convert with CSV tools.
Record the error position and the raw snippet in a bug report. A line/column plus twenty characters around it is more useful than a screenshot of a wall of text.
Put it into practice
Choose the tool that matches your next step. Keep an original copy and inspect the result before using it elsewhere.
JSON formatter and validatorMake JSON readable and identify syntax errors.Data & TablesCSV to JSON converterPrepare tabular exports for a JSON consumer.Data & TablesJSON to CSV converterTurn object records into spreadsheet-ready rows.Data & Tables