What is a JSON Validator?
A JSON Validator checks whether a document follows the syntax and structure required by the JSON standard. It walks the text as a strict parser would: an object must open with { and close with }, an array must open with [ and close with ], every key must be a double-quoted string, every entry must be separated by a comma, and every value must be a string, number, object, array, true, false or null.
If all of that holds, the document is valid JSON and any conforming parser on any platform will read it identically. If it does not, the validator tells you the first place the document stops being JSON, which is usually the fastest route to a fix.
Valid JSON is important because it is the interchange format between systems that do not share code. A configuration file, an API request, a webhook payload, a database export or a settings object all have to be parsed before they can be used. A single stray comma or missing quote is enough to make an entire document unusable, and the failure usually happens far away from the line that caused it.
How to validate JSON online
The workflow is deliberately short: paste, validate, review, fix.
- 1Paste or upload your JSON into the input editor.
- 2Press the Validate JSON button, or use Ctrl+Enter.
- 3Read the validation result - Valid JSON, or Invalid JSON with the exact error.
- 4Fix the reported syntax error and validate again until the document is valid.
JSON validation example
A small valid document first. Every key is quoted, every entry is comma separated and there is no comma after the last property, so the validator reports it as valid:
{
"name": "John",
"age": 30,
"active": true
}{
"name": "John",
"age": 30,
}The trailing comma after "age": 30 is what makes the second document invalid. Standard JSON has no comma after the last entry in an object or an array, so removing it makes the document valid again. The first document has no trailing comma, so it parses cleanly and is reported as valid JSON.
Common JSON syntax errors
These are the mistakes that come up again and again. Each example below is checked with the same parser the tool uses, so the message shown is the message you will actually see.
{
"name": "John",
}Standard JSON does not allow a comma after the last property or the last array item. Remove the comma that sits before the closing brace or bracket.
Trailing comma before '}'. JSON does not allow a comma after the last property - remove it.
{name: "John"}Every object key must be a double-quoted string, so name has to be written as "name". Single quotes and unquoted keys are both rejected.
Unexpected 'n'. JSON object keys must be wrapped in double quotes.
{
"items": [1, 2, 3
}The array is opened with [ but never closed, so the parser reaches the closing } while it is still expecting a comma or a ].
Unexpected '}'. Expected ',' between array items or ']' to close the array. A trailing comma before ']' is not valid JSON.
{"name":"test" "value":123}Two entries in an object or an array must be separated by a comma. Without it the parser cannot tell where the first value ends.
Unexpected '"'. Expected ',' between object entries or '}' to close the object. A trailing comma before '}' is not valid JSON.
{'name': 'John'}JSON strings and keys use double quotes only. Put the document through the JSON Formatter's input or your editor and replace every single quote before validating again.
Unexpected '''. JSON object keys must be wrapped in double quotes.
{
// note
"a": 1
}Comments are not part of the JSON standard. Unlike JavaScript, a JSON file cannot contain // or /* */ comments and still be valid.
Unexpected '/'. JSON object keys must be wrapped in double quotes.
{ "path": "C:\q" }Only \" \\ \/ \b \f \n \r \t and \uXXXX are valid escapes. A backslash followed by any other character is a syntax error.
Invalid escape sequence \q. Valid JSON escapes are \" \\ \/ \b \f \n \r \t and \uXXXX.
{ "value": NaN }NaN, Infinity and undefined are JavaScript values, not JSON values. Use null or a plain number instead.
Unexpected 'N'. Expected a JSON value: an object, array, string, number, or one of true, false, null.
JSON Validator vs JSON Formatter
The two tools are usually used together, but they answer different questions.
The validator answers "is this document correct?". The formatter answers "how do I make a correct document readable?". A formatter assumes the JSON is already valid - it has to parse it before it can re-indent it - whereas a validator is the tool you reach for when the JSON will not parse at all.
| Aspect | JSON Validator | JSON Formatter |
|---|---|---|
| Purpose | Confirms the JSON is syntactically valid | Makes valid JSON easy to read |
| What you get | A valid or invalid verdict, plus the exact error location | The same data re-indented with line breaks |
| Changes your data | No - it only reads it | No - only whitespace is rewritten |
| Typical use | Debugging an API response that will not parse | Reading, reviewing and diffing JSON |
Need to make valid JSON readable? Copy it into our JSON Formatter to add indentation and line breaks in one click.
JSON Validator vs JSON Minifier
The minifier is the opposite end of the same pipeline. Once your JSON is confirmed valid, minifying it removes the whitespace that exists only for humans, which is what you want for a payload, a URL or a cache key.
A minifier refuses to emit output for input it cannot parse, so a validator is the natural first step: confirm the document, then decide whether you want it pretty-printed or compact.
| Aspect | JSON Validator | JSON Minifier |
|---|---|---|
| Purpose | Checks JSON syntax and reports errors | Removes insignificant whitespace |
| Output | Valid / invalid + error message, line and column | One compact single-line JSON document |
| Runs on | Any JSON, valid or broken | Valid JSON only - it refuses to emit output for broken input |
| Typical use | Confirming JSON is correct before shipping it | Shrinking JSON for a payload, URL or cache key |
Want to reduce JSON whitespace after validating? Try the JSON Minifier to compress a valid document into a single line without touching the data.
Frequently Asked Questions
What is a JSON Validator?
A JSON Validator is a tool that checks whether a document follows the JSON standard - the syntax rules defined by RFC 8259. It reads every brace, bracket, comma, colon, quoted string, number and literal in order and confirms that they form exactly one well-formed JSON value. If something breaks the rules, the validator reports what went wrong and where, so you can fix it.
How do I validate JSON online?
Paste your JSON into the input editor on this page, then press the Validate JSON button. The result appears immediately: a green Valid JSON panel when the document is correct, or a red Invalid JSON panel with the parser message, the line, the column and the character position of the first problem. You can also press Ctrl+Enter to validate from anywhere on the page.
How do I check if JSON is valid?
A document is valid when a standard JSON parser can read it without error. That means exactly one top-level value, double-quoted object keys, no trailing commas, no comments, no unquoted or single-quoted strings, and no values such as NaN or undefined. This JSON checker runs that exact parse for you and tells you the answer instantly, without you having to read the whole document yourself.
Why is my JSON invalid?
The most common reasons are a trailing comma before a closing brace or bracket, a missing comma between two entries, unquoted or single-quoted keys, a missing closing bracket, a comment, or a literal newline or tab typed inside a string. Because the error is often not where you see the symptom, the validator points at the first position the parser could not accept, with the offending line shown and a caret under the exact column.
What are common JSON syntax errors?
Trailing commas, missing quotation marks around keys, missing closing braces and brackets, missing commas between entries, single quotes instead of double quotes, comments, invalid escape sequences such as a lone backslash before a normal letter, and JavaScript-only values like NaN, Infinity or undefined. The common JSON syntax errors section on this page shows each one with a real example and the exact message this validator returns.
Does this JSON Validator check JSON syntax?
Yes. Syntax is exactly what it checks. The validator parses your input with the same JSON-aware engine used by the JSON Minifier and the JSON Formatter, so it understands the full grammar: nested objects and arrays, string escapes, Unicode escapes, number formats, booleans and null. What it does not check is whether your data matches your own application rules - for that, use a JSON Schema validator.
Does the validator tell me the line number of the error?
Yes. When the JSON is invalid, the result panel reports the message from the parser together with the line, the column and the character offset of the first problem. Where possible it also prints the offending line and marks the exact column with a caret, so you can jump straight to the fix instead of searching manually. If the parser cannot determine a precise location, none is invented.
Can I validate large JSON files?
Yes. Validation runs entirely in your browser with a streaming-friendly scanner, so there is no upload step and no server-side size limit. Large API responses and multi-megabyte files are checked locally, which also means your data never leaves your device. For extremely large documents, performance depends on the memory available to your browser tab.
Is this JSON Validator free?
Yes, it is completely free. There is no sign-up, no usage limit and no watermark. The tool validates locally in your browser, so it is also private: the JSON you paste is never sent to a server and is never stored.
What is the difference between a JSON Validator and a JSON Schema Validator?
A JSON Validator checks syntax: is this a well-formed JSON document at all? A JSON Schema Validator checks meaning: does this well-formed document match a schema that describes which keys, types and value ranges are allowed? A document can be perfectly valid JSON and still fail schema validation, and a schema can never be checked until the JSON parses. Use this validator first, then a schema validator for your application rules.
Does validating JSON change my data?
No. Validation only reads the document. Nothing is reformatted, re-serialized or rewritten, and the text in the editor stays exactly as you pasted it. If you want to change the formatting afterwards, send it to the JSON Formatter to add indentation or the JSON Minifier to remove whitespace.
Can I validate JSON that contains a BOM or leading whitespace?
Leading whitespace is allowed by the JSON standard and is handled without complaint. A byte order mark at the very start is not part of the JSON value, so this validator strips it before checking, which matches what most modern parsers do and avoids false invalid results for files exported from some Windows tools.