DevFormatter

JSON Lint

Instantly detect JSON syntax errors — shows the exact line and column of every problem.

Our JSON Formatter includes a full JSON linter — paste your JSON and it instantly highlights whether it is valid, with the exact error position shown in the status bar.
Open JSON Linter →

What is JSON Linting?

JSON linting means checking a JSON string for syntax errors against the JSON specification (RFC 8259). A JSON linter reports the exact line and column of any problem — the same concept as linting in programming languages like JavaScript or Python.

The most common JSON errors a linter catches:

  • Trailing commas — ["a", "b",] is invalid JSON
  • Single-quoted strings — JSON requires double quotes
  • Comments — JSON has no comment syntax (// ... and /* ... */ are both invalid)
  • Unquoted keys — keys must always be double-quoted strings
  • Mismatched brackets — every { needs a }, every [ needs a ]

All processing runs entirely in your browser via the native JSON.parse() function — your data never leaves your machine.

Common JSON Errors

Trailing comma

{ "name": "Alice", "age": 30, }  ← invalid
{ "name": "Alice", "age": 30 }   ← valid

Single-quoted strings

{ 'name': 'Alice' }   ← invalid
{ "name": "Alice" }   ← valid

Comments

{
  // user info
  "name": "Alice"
}

Comments are not valid JSON. Use JSONC or JSON5 formats if you need comments in config files.

Frequently Asked Questions

What does JSON lint mean?
JSON lint (or JSON linting) means checking a JSON string for syntax errors — the same concept as linting in programming languages. A JSON linter parses the input against RFC 8259 and reports the exact line and column of any error, such as a trailing comma, single-quoted string, or unquoted key.
What errors does a JSON linter catch?
Trailing commas after the last array item or object property, single-quoted strings (JSON requires double quotes), unquoted keys, JavaScript-style comments (JSON has no comment syntax), missing colons between keys and values, and mismatched or missing braces and brackets.
Is my JSON data sent to a server?
No. All linting runs entirely in your browser using the native JSON.parse() function. Your data never leaves your machine and no account is required.
What is the difference between JSON lint and JSON validation?
JSON lint and JSON validation mean the same thing for basic syntax checking — both verify that a JSON string is well-formed according to RFC 8259. The term "validation" is sometimes extended to include JSON Schema validation, which checks that values match a schema. JSON linting always means syntax checking only.
Can I lint JSON with a trailing comma?
Trailing commas are invalid in JSON and a linter will flag them. They are common in JavaScript object literals and TypeScript config files (tsconfig.json, .eslintrc) but the JSON spec (RFC 8259) does not allow them. If your file uses trailing commas, it is JSON5 or JSONC, not standard JSON.
How do I lint JSON in Node.js?
Use JSON.parse() inside a try/catch block. The thrown SyntaxError message includes the position of the error. For CI pipelines, the command-line tool jsonlint (npm install -g jsonlint) reports errors with line numbers.

Related Tools

Other free developer tools available on DevFormatter.