If you've touched an API, a config file, or modern web development, you've met JSON. It's the format the web uses to move structured data around — and once you can read it, a huge amount of technical plumbing becomes legible.
Here's what JSON is, how its syntax works, and the small rules that trip everyone up at first.
What JSON is
JSON — JavaScript Object Notation — is a lightweight, text-based way to represent structured data. It's easy for humans to read and easy for machines to parse, which is why it became the default language for APIs, config files and data exchange across almost every programming language.
Despite the name, JSON isn't tied to JavaScript — Python, PHP, Java, Go and everything else read and write it happily.
The syntax in one example
JSON is built from key–value pairs inside objects `{ }`, plus arrays `[ ]` for lists. Here's a small example:
`{ "name": "Ada", "age": 36, "admin": true, "roles": ["editor", "owner"] }`
- Objects `{ }` hold key–value pairs.
- Keys are always strings in double quotes.
- Values can be a string, number, boolean (`true`/`false`), `null`, an array, or another object.
- Arrays `[ ]` hold ordered lists of values.
The rules that trip people up
- Double quotes only — keys and strings must use `"`, never single quotes.
- No trailing commas — a comma after the last item is invalid JSON (unlike JavaScript).
- No comments — JSON has no comment syntax.
- Keys must be quoted — `{ name: "Ada" }` is invalid; it must be `{ "name": "Ada" }`.
A single misplaced comma or quote breaks the whole document — which is why a formatter that flags the error is so useful.
Format and validate JSON
Raw JSON from an API often arrives as one unreadable line. The free JSON Formatter pretty-prints it with indentation and highlights syntax errors so you can spot that stray comma instantly.
JSON FormatterFormat, validate and minify JSON instantly.Convert and compare JSON
- JSON to CSV and CSV to JSON — move data between JSON and spreadsheets.
- JSON to TypeScript — generate type definitions from a sample.
- JSON Diff — see exactly what changed between two JSON documents.
- JSON ↔ XML Converter — convert between the two formats.
Debugging an API? Format the response first — a pretty-printed structure makes it obvious where the data you want lives.