JSON Validator

Paste JSON to check it against the JSON specification (RFC 8259). Errors point to the exact line and column and explain the fix in plain English.

Input

Settings

History

Load from URL

What counts as invalid JSON

JSON is strict, and most broken payloads fail for one of a handful of reasons. The validator names each of them precisely instead of printing a generic “unexpected token”:

  • Trailing commas after the last item of an array or object.
  • Single quotes around keys or strings, usually from a Python print() or a hand-written JavaScript object.
  • Missing commas between two properties, often after a line was pasted in.
  • Unquoted keys, comments (// and /* */), undefined, NaN and Infinity, none of which exist in JSON.
  • Python literals such as True, False and None.
  • Bad strings: a raw line break inside quotes, or a backslash that does not start a valid escape (the classic Windows path "C:\Users").
  • Truncated input, where a bracket opened near the top is never closed.
  • Extra content after the first complete value, such as two objects pasted back to back.

How problems are reported

Validation happens as you type. When the input breaks, the offending line is highlighted in the editor, the status bar shows the error count, and the message gives a 1-based line and column plus a hint such as “Add a ‘,’ between the two properties”. The output pane keeps the last valid result, dimmed, so you do not lose your place while fixing a typo. For the common mistakes listed above, the Fix it button repairs the input and shows a diff of every change before you accept it. Press Ctrl/Cmd+Enter to re-run validation on large files, where live checking switches to on-demand.

Some findings are warnings rather than errors. A duplicate key is valid syntax according to the spec, but most parsers silently keep only the last value, so the validator flags it with the position of the repeat. A UTF-8 byte-order mark at the start is removed with a note, because JSON.parse in many runtimes rejects it.

Numbers are checked without losing precision

The parser behind this page is lossless: it keeps numbers as the digits you wrote instead of converting them to JavaScript doubles. An ID such as 9007199254740993 is accepted and printed back unchanged, while JSON.parse would round it to 9007199254740992. If your data carries 64-bit IDs or money amounts, that difference matters when you copy the formatted output back into a request.

Syntax validation is not schema validation

A document can be perfectly valid JSON and still be wrong for your API: a missing email field, a price sent as a string, an unknown enum value. Syntax validation cannot catch any of that, because it only answers “will a JSON parser accept this?”. To check structure and types, use the separate JSON Schema validation feature, which supports drafts 04 through 2020-12 and can also check OpenAPI 3.x and Swagger 2.0 documents. If you have no schema yet, the JSON to JSON Schema converter can draft one from a sample payload.

Everything runs locally in your browser tab, which matters when the payload you are debugging contains customer records or access tokens.

Examples

Trailing comma in an API payload

Invalid: the comma after the last array item is reported at its exact column, and Fix it removes it.

Input
{
  "orderId": "ord_8f2k1",
  "items": [
    { "sku": "KB-104", "qty": 1 },
    { "sku": "MS-220", "qty": 2 },
  ],
  "paid": true
}
Result
Line 5, column 34: Trailing comma before ']'
Open this example in the tool

Python dict printed instead of JSON

Invalid: single-quoted keys are flagged first; True and None would be reported next as Python literals.

Input
{'user': 'aisha', 'active': True, 'manager': None}
Result
Line 1, column 2: Object keys must use double quotes, not single quotes
Open this example in the tool

Valid JSON with a duplicate key

The document parses, but the second “retries” triggers a warning because most parsers keep only the value 5.

Input
{
  "service": "checkout",
  "retries": 3,
  "timeoutMs": 3000,
  "retries": 5
}
Output
{
  "service": "checkout",
  "retries": 3,
  "timeoutMs": 3000,
  "retries": 5
}
Open this example in the tool

Common errors and how to fix them

ErrorCauseFix
Trailing comma before ']'
Explained
A comma follows the last element of an array; JavaScript allows this, JSON does not.Delete the comma, or press Fix it.
Missing comma after line 12
Explained
Two properties or array items sit next to each other without a separator.Add a comma at the end of the line named in the message.
Unexpected '<' where a value was expected
Explained
You pasted an HTML page, typically an error page or login redirect returned instead of the API response.Check the status code and Content-Type of the response; the real JSON never arrived.
Invalid escape sequence '\U' in string
Explained
A single backslash is followed by a character JSON does not recognise, as in a Windows path.Double the backslash (\) or use forward slashes.
Unexpected content after the end of the JSON value
Explained
Several JSON values were pasted one after another, as in a log file.Wrap them in an array, or validate the file as JSON Lines instead.

Frequently asked questions

Which JSON standard does the validator follow?

RFC 8259 / ECMA-404, the same grammar as JSON.parse. Comments, trailing commas and unquoted keys are rejected; use the JSON5 validator for files that allow them.

Can it validate JSON against a schema?

Not on its own: this check is syntax only. The separate JSON Schema validation feature checks types, required fields and formats against a schema you provide.

Why is my JSON valid here but rejected by my application?

Usually the application expects a particular shape, or it rejects duplicate keys or a byte-order mark that the spec tolerates. Check the warnings shown below the editor, then validate against your schema.

Is there a size limit?

There is no fixed limit; the practical ceiling is your device memory. Above about 1 MB the tool stops validating on every keystroke and waits for Ctrl/Cmd+Enter so the tab stays responsive.

Is the JSON I paste sent anywhere?

No. Parsing and validation run in a Web Worker inside your browser, and the page makes no request with your input.

Related tools