A developer-focused guide
A practical checklist for fixing JSON syntax errors
Many JSON errors come from punctuation rather than the meaning of the data. Instead of treating the reported position as the exact cause, inspect the comma, quote, and closing bracket just before it.
Updated 2026-08-25 · 6-minute read
Five rules to check first
JSON uses double quotes for keys and strings, square brackets for arrays, and curly brackets for objects. A trailing comma after the final property is a common difference between a JavaScript object and standard JSON.
- Quote keys and strings with double quotes
- Close objects with `{}` and arrays with `[]`
- Separate items with commas but omit the final comma
- Use `true`, `false`, and `null` as literals
- Comments and trailing commas are not standard JSON
Read the parser location backwards
A parser location often points to the place where reading stopped, not the original mistake. Start a little before the reported line and column, then check quote, comma, and bracket pairing.
- 1.Paste the JSON or open it as a file in the formatter
- 2.Inspect the area around the reported line and column
- 3.Fix one quote, comma, or bracket pair at a time
- 4.Format it again and then verify keys and value types
| Symptom | Common cause | Check |
|---|---|---|
| Unexpected token | Quote or comma placement | Inspect the previous item and closing bracket |
| Unexpected end | Missing closing bracket | Count `{}` and `[]` pairs |
| Value becomes a string | Too many quotes | Check numbers, booleans, and null |
Handle sensitive JSON deliberately
Replace API keys, passwords, and personal data with dummy values before formatting. This site formats JSON in the browser, but browser extensions, sharing actions, and storage destinations are separate parts of the handling path.
- Replace secrets before pasting
- Review values again before sharing formatted output
- Check the permissions and location of any saved file
Before you finish
- Replaced sensitive values
- Inspected before the reported position
- Checked brackets and commas
- Verified value types after formatting