Developer Tool

JSON Validator Online to Check JSON Syntax and Find Errors

Paste or upload JSON and validate its syntax instantly. Find parsing errors, inspect the line and column, format valid JSON, and download the checked result.

JSON Input
Validation Result
Enter JSON and select Validate JSON.
✓Valid JSON

Your input follows valid JSON syntax.

×Invalid JSON

The parser found a syntax problem. Review the diagnostic details below.

Line–
Column–

Type–
Lines–
Characters–
Depth–
Open JSON Formatter
Formatted Valid JSON
Waiting for JSON
0 B0 chars
Tip: Press Ctrl + Enter on Windows/Linux or Cmd + Enter on macOS to validate quickly. This page checks JSON syntax, not JSON Schema rules.

A JSON validator checks whether a JSON document follows valid JSON syntax. Paste or upload your data, run the check, and the UtilityDocks JSON Validator tells you whether the input can be parsed as JSON.

If the syntax is invalid, the tool reports the parser error and, where the browser provides enough information, shows the approximate line and column with a nearby code snippet. If the JSON is valid, you can inspect basic document details and format the result for easier reading.

What Is a JSON Validator?

A JSON validator is a syntax checker for JavaScript Object Notation. It tests whether text follows the grammar defined for JSON, including the rules for objects, arrays, strings, numbers, boolean values, and null.

RFC 8259 defines a JSON value as an object, array, number, string, or one of the lowercase literals true, false, and null. Objects use name/value pairs, arrays contain ordered values, and structural characters such as braces, brackets, commas, and colons must appear in the correct places.

This makes a JSON validator useful when checking API responses, configuration files, webhook payloads, test fixtures, exported data, or any JSON string before it is processed by another application.

How to Validate JSON Online

  1. Paste JSON into the input editor or upload a .json file.
  2. Select Validate JSON.
  3. If the JSON is valid, review the success result and document details.
  4. If it is invalid, check the parser message, line, column, nearby code, and the suggested issue.
  5. After fixing the syntax, validate again until the document passes.

You can also turn on live validation to recheck the input while editing, or use Ctrl + Enter on Windows/Linux and Cmd + Enter on macOS.

What Makes JSON Valid?

Valid JSON follows a small but strict set of syntax rules. A document can be compact or heavily indented because insignificant whitespace is allowed around JSON structural characters, but the underlying grammar still has to be correct.

Rule Valid example Common invalid form
Object property names use double quotes {"name":"Alex"} {'name':'Alex'}
Array values are separated by commas [1,2,3] [1 2 3]
Object names and values are separated by a colon {"active":true} {"active" true}
Literal names are lowercase true, false, null True, False, Null
No trailing comma in strict JSON {"a":1} {"a":1,}

Common JSON Syntax Errors

Trailing commas

A comma after the final object member or final array item is not valid in strict JSON.

{ “name”: “UtilityDocks”, “active”: true, }

The comma after true must be removed.

Single quotes

JSON strings and object property names use double quotation marks. Single-quoted JavaScript-style strings are not valid JSON strings.

{ ‘name’: ‘UtilityDocks’ }

Missing commas

Object members and array values must be separated correctly. A missing comma often causes the parser to flag the next property or value.

{ “name”: “UtilityDocks” “active”: true }

Missing colon

Each object property name must be followed by a colon before its value.

{ “name” “UtilityDocks” }

Unclosed objects, arrays, or strings

An opening brace, bracket, or quotation mark must be properly completed. If the document ends first, the parser may report an unexpected end of input or an unterminated value.

Comments inside JSON

Standard JSON does not include JavaScript-style comments. Data such as // comment or /* comment */ can therefore fail strict JSON parsing even if a relaxed JSON-like format accepts it.

Valid JSON vs Invalid JSON Example

This is valid JSON:

{ “user”: { “name”: “Alex”, “active”: true }, “roles”: [“editor”, “author”], “count”: 2 }

This version is invalid because there is a trailing comma after the last array item:

{ “user”: { “name”: “Alex”, “active”: true }, “roles”: [“editor”, “author”,], “count”: 2 }

How Line and Column Errors Help

Parser errors are most useful when they identify where parsing stopped. A line and column can take you directly to the area around a missing comma, unexpected token, bad quote, malformed number, or incomplete value.

The exact error wording can differ between browsers because JavaScript engines do not all format JSON.parse() errors the same way. That is why this validator shows the parser’s own message and derives line and column information only when the available error information supports it.

Important: an error position often marks where the parser became unable to continue, which may be just after the actual mistake. Always inspect the nearby property or value as well as the exact character indicated.

JSON Validator vs JSON Formatter

A validator and a formatter are related, but they solve different problems.

JSON Validator JSON Formatter
Main job Check JSON syntax Change readable presentation
Main result Valid or invalid Indented or minified JSON
Error diagnostics Primary feature Usually secondary
Best for Debugging malformed JSON Reading or cleaning valid JSON

If your JSON is already valid and you mainly want to change indentation, minify it, sort keys, or create a cleaner presentation, use the JSON Formatter.

JSON Syntax Validation vs JSON Schema Validation

These are not the same type of validation.

JSON syntax validation asks whether the document is valid JSON at all. It checks grammar such as quotes, commas, braces, brackets, numbers, strings, and literals.

JSON Schema validation goes further. JSON Schema can describe expected structure, data types, required properties, allowed values, and other constraints for an already valid JSON instance.

For example, this is syntactically valid JSON:

{ “price”: “free” }

A syntax validator accepts it because the JSON grammar is valid. A separate schema could reject it if that schema requires price to be a number.

The UtilityDocks JSON Validator on this page checks syntax. It does not claim that the data matches a JSON Schema.

Can a JSON Object Have Duplicate Property Names?

RFC 8259 says names within a JSON object should be unique for interoperable behavior. When duplicate names are present, different software can behave differently. Some parsers keep only the last value, while others may report an error or preserve multiple entries.

{ “status”: “draft”, “status”: “published” }

Because normal JavaScript parsing can collapse duplicate names while building an object, successful syntax parsing should not be interpreted as a guarantee that duplicate-name input is safe for every application.

Why Validate JSON Before Using It?

API requests and responses

Malformed JSON can cause an API request to fail before the application can process its intended fields. Validation helps isolate syntax problems from application-level problems.

Configuration files

A missing comma or quote can prevent software from loading configuration data. Checking the JSON first can make these mistakes easier to locate.

Webhook payloads

Webhook examples are often copied from logs, dashboards, or documentation. Validation confirms that the payload text itself is parseable before you debug business logic around it.

Test data and fixtures

Valid test data helps prevent syntax mistakes from being confused with the behavior you are actually trying to test.

JSON Validator FAQs

How do I check if JSON is valid?

Paste the JSON into the validator and select Validate JSON. If parsing succeeds, the tool marks it as valid. If parsing fails, it shows the available error details.

Can I validate a JSON file online?

Yes. Use the Upload .json option to load a JSON file into the validator and check its syntax.

Why is a trailing comma invalid in JSON?

The JSON grammar does not allow an additional comma after the last member of an object or the last element of an array. JavaScript object and array syntax can be more permissive, but strict JSON is not.

Are single quotes valid in JSON?

No. JSON strings and object property names use double quotation marks.

Can a valid JSON document start with an array?

Yes. RFC 8259 allows a JSON text to contain any JSON value, so the root can be an object, array, string, number, boolean, or null.

Does this JSON validator check JSON Schema?

No. This tool checks JSON syntax. Schema validation is a separate task that checks valid JSON data against defined structural and data constraints.

Does valid JSON mean the data is correct?

No. Syntax validity only means the text follows JSON grammar. It does not prove that values are accurate, required business fields are present, or the data follows an application-specific schema.

What is the difference between JSON validation and JSON formatting?

Validation checks whether JSON syntax is valid. Formatting changes how valid JSON is displayed by adding or removing whitespace and indentation.

Technical references: RFC 8259, ECMA-404, MDN Web Docs for JSON.parse() error behavior, and the official JSON Schema documentation for the distinction between syntax validation and schema-based validation.