JSON guide

JSON Lint Online

Lint JSON online by validating syntax and identifying parse errors before using data in code.

Open JSON Validator

How to do it

  1. Paste JSON suspected of having a parser error into JSON Validator.
  2. Read the error message and the position it points to.
  3. Fix the issue manually, or send the input through AI JSON Repair to handle the long tail of common mistakes.

What linting catches and what it doesn't

JSON linting checks one thing: does the input parse as valid JSON under the strict spec. It does not check business rules, field meaning, expected types, or whether your numbers are within an allowed range. Those are schema checks, handled by JSON Schema or JSON to Schema. Treat linting as the syntax pass — if it fails, no other check will run reliably.

  • Lint = syntax: would JSON.parse accept this string?
  • Validate against schema = semantics: do the fields and types match what the API expects?
  • Format = readability: does the indentation make the structure visible?

The most common JSON lint errors

Roughly 90% of lint failures we see fall into a handful of patterns. Knowing them by sight saves you a trip back to the documentation.

  • Trailing comma — a comma after the last item in [] or {}.
  • Single quotes — JSON strings must use double quotes only.
  • Unquoted keys — every object key needs to be a quoted string.
  • Comments — // and /* */ are JavaScript syntax, not JSON.
  • Mismatched brackets — extra or missing { } or [ ].
  • Bad escapes — backslashes inside strings need to be paired with a valid escape character.

From lint failure to working JSON

If the validator reports a position, jump there in your editor and look at the character before it — the parser usually flags the next character after the actual mistake. If you cannot spot it, paste into AI JSON Repair, run repair, then run lint again on the cleaned output. Once the validator returns OK, the JSON is safe to feed into a typed parser, JSON.parse or your service's JSON middleware.

Examples

Trailing comma

Input

{
          "name": "Ada",
          "role": "admin",
        }

Output

Error: Unexpected token } at line 4 column 1.

The trailing comma after "admin" is the actual culprit, but most parsers report the next character.

Single quotes

Input

{ 'host': 'localhost', 'port': 3000 }

Output

Error: Unexpected token ' at line 1 column 3.

JSON strings must use double quotes. Single quotes are valid JavaScript but invalid JSON.

Recommended tool

Related guides

FAQ

What is JSON linting?

JSON linting is a syntax check that confirms whether the input is valid under the strict JSON spec.

Does linting format JSON?

No. Linting only validates. Use JSON Formatter when you also want readable output.

What should I do with an error?

Read the line and column, fix the character at that position, and re-run. If you cannot spot the issue, run AI JSON Repair.

Is JSON Lint the same as ajv?

ajv validates against a JSON Schema, which is a stricter check on top of the syntax pass. Linting here means just the syntax pass.

Can I lint JSONL?

Lint each line individually, or use JSON Lines to JSON to convert it into an array first.