Trailing comma: remove the comma after the last item (line 8, column 3)
How to use
- Paste or type your JSON into the Input box.
- Read the result: Valid JSON with counts of objects, arrays, keys and nesting depth, or the first error with its line and column.
- Go to that line and column, fix the mistake, and the check runs again as you type.
- Press Clear to empty the box and start over.
Examples
| Input | Output |
|---|---|
{"id": 1, "tags": ["a", "b"]} | Valid JSON Objects: 1 Arrays: 1 Keys: 2 Max depth: 2 |
{'id': 1} | Strings need double quotes, not single quotes (line 1, column 2) Objects: 0 Arrays: 0 Keys: 0 Max depth: 0 |
[1, 2, 3,] | Trailing comma: remove the comma after the last item (line 1, column 10) Objects: 0 Arrays: 0 Keys: 0 Max depth: 0 |
About this tool
What this checks
Your text is parsed as strict JSON, the grammar defined in RFC 8259, and the check stops at the first error. The message names the problem in plain words with its line and column, both counted from 1. Fix it and the next error, if any, shows up. When nothing is wrong you get Valid JSON with the number of objects, arrays and keys and the deepest nesting level: {"a": [1, 2]} has 1 object, 1 array, 1 key and depth 2.
Errors and how to fix them
| Problem | Example | Fix |
|---|---|---|
| Trailing comma | [1, 2,] |
Delete the comma; the error points at the bracket after it |
| Missing comma | {"a": 1 "b": 2} |
Add , between members |
| Missing colon | {"a" 1} |
Write "a": 1 |
| Single quotes | 'Kobako' |
Use double quotes |
| Unquoted key | {id: 1} |
{"id": 1} |
| Comment | // note |
Delete it |
| Invalid escape | "C:\data" |
"C:\\data" |
| Line break or tab inside a string | pressing Enter inside quotes | Write \n or \t |
| Invalid number | 01, 1., .5, NaN, Infinity |
1, 1.0, 0.5, or null |
| Wrong case | True, NULL |
true, null |
| Extra text after the JSON | two documents pasted together | Keep one, or wrap them in an array |
| Unexpected end | a missing }, ] or " |
Close what you opened |
Strict JSON vs JSON5, JSONC and JavaScript
Plenty of files that look like JSON are something looser. tsconfig.json and VS Code's settings.json are JSONC, which allows comments and trailing commas. JSON5 also allows single quotes and unquoted keys, and an object copied from JavaScript code often has all of these. JSON.parse in browsers and Node.js, and most APIs, reject them. So a config file with comments fails here: that is the right answer for strict JSON, not a bug.
What "valid" does not mean
Valid only means the syntax is correct. A missing field, a number sent as a string or a misspelled key all pass. To check structure and types, describe the expected shape with JSON Schema and run a schema validator.
Privacy
The check runs in your browser. Nothing you paste is uploaded, so you can check API responses and config files that contain internal data.
Frequently asked questions
Why does my JSON with comments show an error?
Standard JSON (RFC 8259) has no comments. Files like tsconfig.json use JSONC, a looser variant. Remove the // or /* */ comments to make the text valid JSON.
Are trailing commas allowed in JSON?
No. A comma right before a closing } or ] is a syntax error in JSON, even though JavaScript and JSON5 accept it. Delete the last comma.
Can JSON strings use single quotes?
No. JSON strings and keys must use double quotes. 'text' is an error; write "text" instead.
Does Valid JSON mean my data is correct?
No. It only means the syntax is correct. Missing fields or wrong types still pass; use JSON Schema to check the structure.
Is my JSON uploaded anywhere?
No. The check runs entirely in your browser, and nothing you paste leaves your device.