JSON (JavaScript Object Notation) is the most common way apps and websites exchange data. When your weather app loads the forecast, or an online shop loads its product list, the data almost always travels as JSON. You do not need to be a programmer to read it — once you know four or five rules, a JSON file becomes as readable as a shopping list.
The building blocks
JSON is made of only six kinds of values. Objects are wrapped in curly braces and hold named fields. Arrays are wrapped in square brackets and hold ordered lists. The remaining four are strings (text in double quotes), numbers, true/false, and null, which means 'no value'.
- Object: {"name": "Ali", "age": 24}
- Array: ["red", "green", "blue"]
- String: "Hello" — always double quotes, never single
- Number: 42 or 3.14 — no quotes
- Boolean and null: true, false, null — lowercase only
The five mistakes that break JSON
In our experience testing thousands of snippets with the Legend Tools JSON Formatter, nearly every error falls into one of five groups. Learning them saves hours of frustration.
- A trailing comma after the last item, such as [1, 2, 3,]
- Single quotes instead of double quotes around text or keys
- Keys without quotes, like {name: "Ali"}
- Comments — standard JSON does not allow // or /* */
- A missing closing brace or bracket deep inside a nested object
How to find an error quickly
Paste the text into a formatter and press Format. A good tool reports the position of the first problem. Look just before that position — the real mistake is usually one character earlier, often a missing comma or an extra one. Fix it, format again, and repeat until the output is clean and neatly indented.
Minify or beautify?
Beautified JSON has line breaks and indentation, which makes it easy for people to read and review. Minified JSON removes all extra spaces, which makes files smaller and faster to send. Use beautified JSON while you are editing or debugging and minified JSON when you deploy configuration files or send data over a network.
Keep sensitive data private
API responses often contain email addresses, tokens or order details. Many online formatters upload whatever you paste to their servers. The Legend Tools formatter runs entirely in your browser, so the data never leaves your device. Even so, it is good practice to remove passwords and secret keys before sharing JSON with anyone.
Quick checklist
- Every key is in double quotes
- No comma after the last item
- Every { has a matching } and every [ a matching ]
- true, false and null are lowercase
- Format it once before saving to catch hidden mistakes