Skip to content
Developer GuideJSON & Data

How to Validate JSON

Learn how to validate JSON, understand common syntax errors, interpret parser messages, and fix malformed objects, arrays, strings, or values.

What does JSON validation mean?

JSON validation usually begins with a syntax check: can a standards-compliant parser turn the text into an object, array, string, number, Boolean, or null value? A valid document uses double-quoted strings, legal escape sequences, correctly placed commas and colons, and balanced braces or brackets.

Validation is useful before saving configuration, sending an API request, importing a fixture, or debugging a response that another system rejected.

JSON syntax validation versus JSON Schema

Syntax validation answers whether the text is JSON. It does not prove that a user object contains an email field or that a quantity is positive. Those structural and business rules require JSON Schema or application-specific validation after parsing.

Orbilyra's validator is a syntax checker. It helps locate malformed text but does not claim to validate a document against a schema.

How to validate JSON online

  1. Open the JSON Validator.
  2. Paste the complete JSON document into the editor.
  3. Select Validate JSON.
  4. If parsing fails, read the error and inspect the nearby character or line.
  5. Correct one syntax problem at a time, then validate again.

The input stays in your browser. When the document is valid, you can use the JSON Formatter to make nested data easier to read.

Invalid JSON example: a trailing comma

Invalid

{
  "name": "Orbilyra",
  "active": true,
}

Corrected

{
  "name": "Orbilyra",
  "active": true
}

The comma after true says another property should follow, but the object ends instead. Removing that comma produces valid JSON without changing the intended data.

Common JSON syntax errors

  • Single quotes: strings and property names require double quotes.
  • Unquoted keys: {name: "Ada"} is a JavaScript object literal, not JSON.
  • Missing commas or colons: separators must appear in exact positions.
  • Trailing commas: the final property or array item cannot be followed by a comma.
  • Invalid escapes: a backslash must introduce a recognized escape or Unicode sequence.
  • Unsupported values: undefined, NaN, Infinity, functions, and comments are not JSON values.

How to interpret parser errors

A parser often reports the point where it became impossible to continue, not necessarily where the original mistake began. If it reports an unexpected token, inspect the preceding string, comma, colon, brace, or bracket as well as the highlighted character.

For deeply nested input, first validate the smallest relevant object or array. Once the syntax is correct, read How to Format JSON to make the structure easier to review.

FAQ

Frequently asked questions

What does JSON validation check?

Syntax validation checks whether text follows the JSON grammar, including correctly quoted strings, valid values, separators, and balanced objects or arrays.

Why is a trailing comma invalid in JSON?

The JSON grammar requires a value after every comma. Unlike some JavaScript object literals, strict JSON does not permit a comma after the final property or array item.

Is valid JSON guaranteed to contain the right data?

No. Syntax validation only proves that the text can be parsed. JSON Schema or application rules are needed to validate required fields, types, ranges, and business constraints.

Can comments appear in JSON?

No. Standard JSON does not support line or block comments. Formats such as JSONC are separate extensions and may not work with strict JSON parsers.

Does Orbilyra upload JSON for validation?

No. Orbilyra parses JSON locally in your browser and does not send the input to a server.

← Back to Developer Guides