JSON Validator
Paste JSON to validate and lint it instantly. Get the exact line and column of any syntax error and a hint explaining what went wrong.
Just need to beautify or pretty print valid JSON? Use the JSON Formatter →
Common JSON errors
- ·Missing comma between values
- ·Trailing comma after last item
- ·Single-quoted strings (use double quotes)
- ·Unquoted object keys
- ·Comments (// or /* */ not allowed)
- ·undefined, NaN, Infinity as values
Valid JSON types
- ·string — "hello"
- ·number — 42, 3.14, -1, 1e5
- ·boolean — true / false
- ·null — null
- ·array — [1, 2, 3]
- ·object — {"key": "value"}
Quick rules
- ·Always double-quote keys and strings
- ·No trailing commas in objects or arrays
- ·No comments of any kind
- ·Numbers must not have leading zeros
- ·Top level can be any JSON value
- ·Whitespace outside strings is ignored
Frequently Asked Questions
Why is my JSON invalid?↓
The most common JSON errors are: a missing comma between values (e.g. {"a":1 "b":2}), a trailing comma after the last item ({"a":1,}), single-quoted strings instead of double-quoted ('hello' should be "hello"), unquoted object keys (name: instead of "name":), and JavaScript-only values like undefined, NaN, Infinity, or comments which are not allowed in JSON.
What is the difference between JSON and JavaScript object syntax?↓
JSON is a strict data interchange format derived from JavaScript but with tighter rules: all keys and string values must use double quotes, trailing commas are not allowed, comments are not allowed, and values must be one of string, number, boolean, null, object, or array. JavaScript object literals are more permissive — they allow single quotes, unquoted keys, trailing commas, and comments.
How do I fix a JSON parse error?↓
Paste your JSON into the validator at www.njhouse.kr/tools/json-validator. It shows the exact line and column of the error, displays the offending source line, and provides a hint explaining the cause. Common fixes: add a missing comma, remove the trailing comma after the last item, replace single quotes with double quotes, or quote unquoted keys.
Can JSON have comments?↓
No. Standard JSON (as defined by RFC 8259 and ECMA-404) does not allow comments of any kind — neither // single-line nor /* */ block comments. If you need a JSON-like format with comments, consider JSONC (used in VS Code config files) or JSON5, but these require a dedicated parser and are not valid JSON.
Are trailing commas allowed in JSON?↓
No. Trailing commas — a comma after the last item in an array ([1, 2, 3,]) or the last property in an object ({"a": 1,}) — are not valid in standard JSON and will cause a parse error. They are allowed in JavaScript object literals and in some JSON supersets like JSON5 or JSONC, but not in JSON itself.
Is a JSON validator the same as JSON lint?↓
Yes — "JSON lint" is the common name for checking JSON syntax. The validator at www.njhouse.kr/tools/json-validator lints JSON as you type and reports the exact line, column, and cause of any error. If your JSON is already valid and you only want to beautify it, use the JSON Formatter at www.njhouse.kr/tools/json-formatter.
Last updated: