Paste JSON below and instantly see whether it conforms to the JSON specification. If invalid, get the exact line and column of the error with a clear description of what went wrong. Free, fast, and 100% browser-based.
Validation results will appear here
A JSON validator is a tool that checks whether a piece of text conforms to the JSON specification (RFC 8259). It tells you immediately whether your JSON is syntactically correct and, if not, where the problem is. Unlike a JSON formatter — which assumes input is already valid — a validator's primary job is error detection.
JSON validation matters because most JSON consumers (REST APIs, databases, config loaders) fail loudly when they encounter invalid JSON. A trailing comma in a config file can crash an entire application. An unquoted key in an API request can return a confusing 400 error. Catching these issues with a validator before the data reaches production is faster than debugging downstream failures.
Our JSON validator uses the browser's native JSON.parse for validation — the same parser used by every JavaScript runtime, fully compliant with RFC 8259 and ECMA-404. When validation fails, we extract the parser's error position and convert it to a precise line and column number, then explain what went wrong in plain English.
Three steps:
.json file or drag and drop one onto the panel.For valid JSON, the right panel shows your data pretty-printed with syntax highlighting — making it easy to spot logical issues (wrong types, missing fields, unexpected nesting) even after the syntax checks out.
Every type of error the JSON specification considers invalid:
The #1 cause of "invalid JSON" — a comma right before } or ]. The validator points to the comma's exact column.
JSON allows only double quotes for strings and keys. {'a':'b'} fails; {"a":"b"} works. The validator highlights the offending quote.
JavaScript object literal syntax allows unquoted keys, but JSON requires every key in double quotes.
JSON has no comment syntax. Both // and /* */ cause validation errors. For comment support you need JSONC or JSON5.
Missing opening or closing braces and brackets are caught with the line where the parser ran out of expected tokens.
undefined, NaN, Infinity, and functions all fail validation. Use null or string sentinels instead.
Inside strings, only specific backslash escapes are legal: \\, \", \/, \b, \f, \n, \r, \t, \uXXXX. Anything else is rejected.
JSON numbers don't allow leading zeros (except for 0 itself) or trailing decimals like 5.. Numbers must be written canonically.
Unescaped control characters (U+0000 through U+001F) inside strings are illegal. Use Unicode escapes like \u0001 if you need them.
JSON validation is essential in every development workflow that involves machine-readable data:
package.json or tsconfig.json can break your build for the whole team. Validate before committing.For programmatic validation, every language has built-in support:
JSON.parse(text) throws SyntaxError if invalid; wrap in try/catch.json.loads(text) raises json.JSONDecodeError with line/column info.json.Unmarshal(data, &v) returns a SyntaxError with byte offset.serde_json::from_str::<Value>(text) returns a Result with detailed error info.jq . file.json validates and pretty-prints in one step; jsonlint file.json is dedicated to validation.Our online validator complements these for situations where you don't want to write or run code — quick spot checks, debugging in a browser, or sharing the validation result with someone who can't run command-line tools.
json.loads, JavaScript's JSON.parse) are strict — if one of them accepts your input, ours will too. If you're using a third-party library like json5 or simplejson with relaxed flags, those accept input we correctly reject.{"age": "thirty"} is valid JSON even if your code expected age to be a number. To enforce types, you need schema validation. The syntax validator only checks that the input parses as valid JSON; it makes no assumptions about what the data should mean.jq or a language-specific streaming library.jsonlint --strict or biome.