JSON Validator Online
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
What is a JSON validator?
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.
How to validate JSON online
Three steps:
- Paste your JSON into the input area. You can also upload a
.jsonfile or drag and drop one onto the panel. - Validation is automatic. The tool checks your JSON as you type with a 150ms debounce. A green indicator means valid; red means invalid.
- If invalid, read the error. The status message tells you the exact line and column where parsing failed, plus an explanation of what's wrong (missing comma, unexpected token, unquoted key, etc.).
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.
What kinds of errors does this validator catch?
Every type of error the JSON specification considers invalid:
, Trailing commas
The #1 cause of "invalid JSON" — a comma right before } or ]. The validator points to the comma's exact column.
' Single quotes
JSON allows only double quotes for strings and keys. {'a':'b'} fails; {"a":"b"} works. The validator highlights the offending quote.
a Unquoted property keys
JavaScript object literal syntax allows unquoted keys, but JSON requires every key in double quotes.
// Comments
JSON has no comment syntax. Both // and /* */ cause validation errors. For comment support you need JSONC or JSON5.
{} Unbalanced brackets
Missing opening or closing braces and brackets are caught with the line where the parser ran out of expected tokens.
∞ Non-JSON values
undefined, NaN, Infinity, and functions all fail validation. Use null or string sentinels instead.
\ Bad escape sequences
Inside strings, only specific backslash escapes are legal: \\, \", \/, \b, \f, \n, \r, \t, \uXXXX. Anything else is rejected.
. Leading zeros & decimals
JSON numbers don't allow leading zeros (except for 0 itself) or trailing decimals like 5.. Numbers must be written canonically.
U+ Invalid Unicode
Unescaped control characters (U+0000 through U+001F) inside strings are illegal. Use Unicode escapes like \u0001 if you need them.
When do you need a JSON validator?
JSON validation is essential in every development workflow that involves machine-readable data:
- Before sending an API request. If you're constructing JSON manually for a curl command or HTTP request, validate it first to avoid 400 errors that don't always explain the cause.
- After receiving an API response. Sometimes APIs return mostly-JSON with stray HTML or error text mixed in. Validation reveals when a response isn't what you expected.
- Committing config files. A broken
package.jsonortsconfig.jsoncan break your build for the whole team. Validate before committing. - Migrating data. When exporting JSON from one system to import into another, validation catches corruption or truncation early.
- Writing JSON by hand. Hand-edited JSON is the most common source of syntax errors. The validator turns trial-and-error into a one-step fix.
- Debugging integrations. When two services communicate in JSON and something breaks, validating the payloads at the boundary often pinpoints which side has the bug.
JSON validation in code (alternatives to this tool)
For programmatic validation, every language has built-in support:
- JavaScript:
JSON.parse(text)throwsSyntaxErrorif invalid; wrap in try/catch. - Python:
json.loads(text)raisesjson.JSONDecodeErrorwith line/column info. - Go:
json.Unmarshal(data, &v)returns aSyntaxErrorwith byte offset. - Rust:
serde_json::from_str::<Value>(text)returns aResultwith detailed error info. - Java: Jackson or Gson — both throw exceptions with line numbers.
- Command line:
jq . file.jsonvalidates and pretty-prints in one step;jsonlint file.jsonis 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.
FAQ — Json Validator
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.Everything on this page runs in your browser — no upload, no server-side processing. How it works →