Skip to content

JSON Validator

This JSON validator checks your JSON against the standard and shows each error with its line, column, the lines around it and a fix.

Input · JSON

Invalid JSON

Line 7, column 23

Trailing comma before '}'.

5  "env": {6    "LOG_LEVEL": "info",7    "TIMEOUT_MS": 3000,                       ^8  },

Fix: JSON does not allow a comma after the last property. Delete it.

Why this happens
Invalid JSONRuns in your browser

Load from a URL

Your browser fetches it directly, so the server must allow cross-origin requests (CORS).

How to validate JSON

  1. Paste JSON, press Open file, or use From URL. It is checked as you type.
  2. Read the Report: what broke, the line and column, the lines around it and a fix.
  3. Press Go to error to jump there, or Repair JSON to fix common mistakes in one go.
  4. Once it passes, the report lists size, depth and counts of keys, strings, numbers and nulls. Validate (Ctrl + Enter) checks again.

Where the error really is

This config is missing a comma:

{
  "name": "deploy-bot",
  "retries": 3
  "regions": ["eu-west-1", "us-east-1"]
}

The Report shows:

Invalid JSON
Line 3, column 15

Missing comma between properties.

1  {
2    "name": "deploy-bot",
3    "retries": 3
                 ^
4    "regions": ["eu-west-1", "us-east-1"]

Fix: Add ',' after the value on the highlighted line.

JSON.parse in Chrome and Node.js reports the same text as SyntaxError: Expected ',' or '}' after property value in JSON at position 43 (line 4 column 3), one line late. The validator points at the end of line 3, where the comma belongs.

Strict syntax, plus two warnings

The rules are RFC 8259 with no extensions. Comments, trailing commas, single quotes, unquoted keys, NaN, Python’s True and None, leading zeros such as 02134, raw tabs or line breaks inside strings, and text after the last bracket are errors. When the problem is not a typo, the report names it: an HTML page, the text [object Object], curly quotes, a non-breaking space, or a byte order mark.

Two things are legal but cause bugs, so they are warnings:

  • Duplicate keys. With "status": "sent" followed by "status": "delivered", JavaScript and Python keep only the second.
  • Integers too large for JavaScript. Past 9,007,199,254,740,991, integers can lose digits: JSON.parse reads 1854123456789012345 as 1854123456789012200.

Syntax only

Valid JSON can still be the wrong data, such as a missing field or a string where your code expects a number. Check fields, types and ranges with the JSON Schema validator.

Errors the JSON validator explains

Why this happens in the report opens the error’s own page when there is one:

The rest are in common JSON errors. JSON Repair fixes quotes, commas and comments in one pass.

Questions

Why does my JSON pass here but fail in my code?

Your code is probably parsing different text: an empty response body, an HTML error page, or a file that starts with a byte order mark. Log the raw string right before you parse it and paste that.

Can it check JSON from a URL?

Yes. From URL fetches it from your browser, so the server must allow cross-origin requests (CORS). If the server answers with an error status or sends HTML, a message tells you.

Why is a duplicate key a warning and not an error?

RFC 8259 says the names in an object SHOULD be unique, not that they must be, so the text is still valid JSON. Fix it anyway: parsers quietly drop all but one of the values, and some refuse the file.

Does it accept JSON5 or JSONC?

No. Comments, trailing commas and unquoted keys are errors because standard JSON parsers reject them. VS Code settings and tsconfig.json are JSONC, so expect errors on their comments.

Related tools

Esc