Format before you debug

Minified API responses hide structure. Pretty-printing adds indentation and line breaks without changing values, making nested objects and arrays easier to scan.

A formatter should parse before it prints. If parsing fails, fix the first reported syntax error before chasing later messages because one missing quote or comma can shift the rest of the document.

Common JSON syntax failures

Strict JSON is smaller than JavaScript object syntax. It rejects several conveniences developers often type from habit.

  • Property names must use double quotes.
  • Strings must use double quotes, not single quotes.
  • Trailing commas are not allowed.
  • Comments, undefined, NaN and functions are not JSON values.

Protect production payloads

Authentication tokens, customer records and unreleased API responses should not be pasted into tools that send data to a server. Prefer converters that operate locally and confirm the browser network panel stays quiet when your data is sensitive.

Primary references

Read the specification

RFC Editor · RFC 8259The JavaScript Object Notation Data Interchange FormatMDN Web DocsJSON.parse()

Put the guide into practice

Open the related browser tools and test the workflow with a synthetic sample

JSON Formatter JSON Validator JSON Minifier JSON Key Sorter