Data · DEVELOPER GUIDE

How to Validate and Format JSON

Avoid common JSON parsing mistakes and format payloads before debugging APIs.

JSON is a simple interchange format, but its syntax is stricter than JavaScript object literals. Keys and string values need double quotes.

Objects and arrays

JSON objects hold named properties, while arrays hold ordered values. Common types include strings, numbers, booleans and null.

Frequent errors

Trailing commas, unquoted property names, single-quoted strings and comments are not valid in standard JSON.

Formatting for readability

Pretty-print data while developing, and prefer compact payloads when transferring large amounts of data. Always check that parsing succeeds.

Try an example yourself

Explore a related developer utility and apply what you learned.

Open related tool ↗