JSON Validator

Validate JSON syntax and pinpoint errors with clear location hints.

Input data is processed in your browser
Data is never sent to a server

Tool

0 chars

or drag & drop a file

What is JSON Validator?

JSON Validator checks whether your JSON text is syntactically correct. When there is an error, it shows the error message and highlights the approximate location. When the JSON is valid, it displays structural information such as the number of keys, maximum nesting depth, and array count. Useful for debugging API responses, configuration files, and hand-written JSON.

When this comes in handy

  • You need to confirm an API response or config file is actually valid JSON: missing commas or unquoted keys are easy to miss by eye. Paste the text in and get an instant pass/fail answer.
  • You know something is wrong but can’t spot it: scanning a long JSON blob for a single misplaced character is slow. The tool extracts the text around the error and marks it with a ^, so you can jump straight to the problem.
  • You want a quick sense of the JSON’s shape: stats like key count, max nesting depth, array count, and null count give you an at-a-glance summary of how complex the data is.
  • You’re not sure whether to use this or JSON Formatter: use JSON Formatter to pretty-print or minify; use JSON Validator when you just need to know if the syntax is correct, or want structural stats.

Usage examples

Example 1: Validating valid JSON

Input:

{
  "name": "Taro",
  "age": 28,
  "tags": ["admin", "editor"],
  "address": {
    "city": "Tokyo",
    "zip": null
  }
}

Result:

Status: Valid JSON
Root type: Object

Keys: 6
Max depth: 2
Arrays: 1
Nulls: 1

Notice how the single tags array and the single zip: null inside address are both correctly counted.

Example 2: Validating JSON with a trailing comma

Input:

{"name": "Taro", "age": 28,}

There’s an extra comma right after the age value, which makes this invalid JSON.

Result:

Status: Invalid JSON
Error: Expected double-quoted property name in JSON at position 27 (line 1 column 28)

Location:
...: "Taro", "age": 28,}...
                    ^

The ^ marker points to the position right before the closing } — that’s where the stray trailing comma is. Removing it produces valid JSON.

Common error patterns

  • Trailing comma: an extra , left after the last element of an array or object
  • Unquoted keys: a key that isn’t wrapped in double quotes, or uses single quotes instead
  • Unescaped characters in strings: a raw newline or double quote inside a string value
  • Missing comma: no comma between two keys or two array elements

How to Use

  1. Paste your JSON into the input field.
  2. Click "Validate" or enable auto-validate to check in real time.
  3. If the JSON is invalid, the error message and approximate location are shown.
  4. If the JSON is valid, structural stats such as key count and max depth are displayed.

FAQ

How is this different from JSON Formatter?

JSON Formatter focuses on pretty-printing and minifying. JSON Validator focuses on syntax checking, error location, and structural statistics.

How is the error location shown?

The tool extracts the characters around the parse error position and places a "^" marker below the problem character.

Is my data sent to a server?

No. All processing happens in your browser. Nothing is sent to a server.

How is "max depth" counted in the stats?

The outermost object or array is depth 0, and depth increases by 1 each time a value is nested one level deeper. Deeply nested structures, such as objects inside arrays, produce a higher depth value.

Can I validate JSON where the root is an array instead of an object?

Yes. The root element can be an array, string, number, boolean, or null. When valid, the root type is shown, for example as "Array (N elements)".