JSON guide

JSON Parser Online

Parse JSON online to confirm whether a value is a valid object, array, string, number, boolean or null.

Open JSON Validator

How to do it

  1. Paste any JSON value (object, array, scalar) into JSON Validator.
  2. Run validation — the validator parses your input behind the scenes.
  3. Read the result summary to confirm the top-level type and whether parsing succeeded.

What a JSON parser actually does

A JSON parser reads a string of characters and produces structured data — an object tree your code can index into. The parser walks token by token, validating each one against the JSON grammar. If anything is out of place, parsing stops and the parser reports an error pointing to the offending token. JSON Validator on this site uses the browser's built-in JSON.parse, which is the same parser used by every JavaScript runtime.

Top-level JSON values you can paste

JSON is more permissive than people remember. The top-level value does not have to be an object. Any of these are valid JSON documents:

  • Object: {"key": "value"}
  • Array: [1, 2, 3]
  • String: "hello"
  • Number: 42
  • Boolean: true or false
  • Null: null

Why parsing fails

Parser failures fall into three buckets: syntax mistakes (trailing commas, single quotes, unquoted keys), encoding issues (smart quotes copied from a chat app, mismatched escape sequences) and structural mistakes (mismatched brackets, missing closing quote on a string). The parser reports the position of the unexpected token, which is usually one character past the actual mistake. If the input came from an LLM, run AI JSON Repair before parsing — it handles the long tail of LLM-specific issues automatically.

Examples

Top-level array parses fine

Input

["alpha", "beta", "gamma"]

Output

Valid JSON. Top-level type: array (3 items).

A standalone array is a valid JSON document — you do not need to wrap it in an object.

Top-level scalar also parses

Input

true

Output

Valid JSON. Top-level type: boolean.

Booleans, numbers, strings and null are all valid top-level JSON values.

Recommended tool

Related guides

FAQ

Can JSON be an array?

Yes. A valid JSON document can be an object, array, string, number, boolean or null at the top level.

What does a JSON parser do?

It reads JSON text and converts it into structured data your code can navigate.

Why does parsing fail?

Parsing fails when syntax does not match the strict JSON grammar — usually trailing commas, comments, single quotes or mismatched brackets.

Is the parser online or local?

The parser runs in your browser. Nothing is sent to a server when you click validate.

Can I parse very large payloads?

Browser parsers handle multi-megabyte inputs but slow down on very large files. For huge payloads, parse in a Node script or use streaming JSON.