JSON Validator

Check JSON instantly with exact line and column errors, or identify non-standard JSON5-style syntax. ✓ Private — runs in your browser

Validation workspaceResults update as you type
Parsed preview

        

What counts as well-formed JSON

JSON is defined by RFC 8259 and ECMA-404. A JSON text is exactly one value: an object, an array, a string, a number, or one of the literals true, false, and null. The rules that trip people up:

The six errors that cause almost every failure

ErrorCauseFix
Trailing commaA comma after the last item: {"a":1,} or [1,2,]Delete the comma before the closing } or ]
Single quotesCopied from JavaScript or Python: {'a': 'b'}Replace every ' around strings and keys with "
Missing commaTwo items with only whitespace between them: {"a":1 "b":2}Add a comma between every key/value pair and every array element
Unquoted keyJavaScript object literal syntax: {name: "Alice"}Wrap every key in double quotes: {"name": "Alice"}
Unescaped characterA raw newline, tab, or " inside a stringEscape it: \n, \t, \"
Wrong value typeA JavaScript expression as a value: "date": new Date(), "x": undefinedSerialize it first — an ISO string, a number, null

JSON vs JSON5 vs JSONC

FeatureJSONJSONCJSON5
Comments // /* */NoYesYes
Trailing commasNoYesYes
Single-quoted stringsNoNoYes
Unquoted keysNoNoYes
.5, 5., +1, hex, Infinity, NaNNoNoYes
Typical useAPIs, config sent over the wire, data filestsconfig.json, VS Code settings.jsonHand-edited config where ergonomics matter

JSONC and JSON5 are editor and tooling conveniences. An HTTP API, JSON.parse, and most language standard libraries accept strict JSON only, so anything you send to a service you do not control should validate here with leniency mode off.

Questions

What makes JSON valid?

A single value with double-quoted strings and keys, no trailing commas, no comments, no leading zeros or + on numbers, and no NaN or Infinity. RFC 8259 is the spec.

Why does my JSON fail when it looks fine?

Usually a trailing comma, single quotes, a missing comma between items, an unquoted key, or a JavaScript expression used as a value. The caret shows which character.

Is JSON with comments valid?

No. Comments make it JSONC. Enable leniency mode to parse it anyway and see each comment located.

JSON vs JSON5 vs JSONC?

JSON is strict. JSONC adds comments and trailing commas. JSON5 also adds single quotes, unquoted keys, and looser numbers. Only strict JSON is safe for arbitrary APIs.

Is my JSON uploaded?

No. Parsing and validation run locally in your browser. Nothing leaves the page.