Developer Tool

JSON Validator

Live syntax validation with exact error location, type tree inspector, stats panel, and JSON Schema checking. Everything runs in your browser.

Input JSON
Formatted output

What This Tool Does

Four tools in one: live syntax validator, formatted viewer, type inspector, and schema checker.

Live syntax validation
Validates as you type in live mode. Detects invalid JSON instantly and shows the exact line and column of the error — no need to hunt through hundreds of lines manually.
🌳
Type tree inspector
Shows the data type of every value — string, number, boolean, null, object, array — with key counts and array lengths. Indented up to 4 levels deep for nested structures.
📊
Stats panel
Counts total object keys, arrays, strings, numbers, booleans, and nulls across the entire document. Shows maximum nesting depth. Useful for understanding large API responses.
📋
JSON Schema validation
Paste a JSON Schema and validate your data against it. Supports type, required, properties, minLength, maxLength, pattern, minimum, maximum, enum, const, items, allOf, anyOf, not.
🎨
Syntax-highlighted output
Valid JSON is formatted with 2-space indentation and syntax highlighting — keys, strings, numbers, booleans, and null each in a distinct colour.
🔒
100% client-side
All validation, schema checking, and type inspection run in your browser. Your JSON data never leaves your device — safe for API responses and config files.

How to Use

1
Paste or upload JSON
Type or paste JSON into the editor, or click Upload to load a .json file. Live mode validates as you type. Use "Invalid sample" to see what an error report looks like.
2
Read the error
If validation fails, the error message shows exactly which line and column has the problem. Common fixes: replace single quotes with double quotes, remove trailing commas, quote unquoted keys.
3
Inspect the type tree
Switch to the Type Tree tab to see the data type of every field. Useful for confirming that a field you expect to be a number is not a string, or that required keys are present.
4
Validate against a schema
Open the JSON Schema tab, paste your schema, and click Validate. Schema violations list the exact path and rule that failed — ideal for API contract testing.

Frequently Asked Questions

Validation checks that the text is syntactically correct JSON — that every string is quoted, brackets are matched, commas are placed correctly, and no trailing commas appear. Formatting (beautifying) takes valid JSON and applies consistent indentation and line breaks. This tool does both: it validates first, then shows formatted output if the JSON is valid.

JavaScript's JSON parser gives errors like "Unexpected token" at a character position. The most common causes are: trailing commas after the last item in an array or object (not allowed in JSON); single quotes instead of double quotes for strings and keys; unquoted keys; comments (JSON has no comment syntax); and values like undefined, NaN, or Infinity (not valid JSON). This validator shows the exact line and column to help you find the problem.

JSON Schema is a vocabulary for describing the structure and constraints of JSON data. You define rules — for example, that a field must be a string with at least 3 characters, or that an object must have certain required keys — and the validator checks your data against them. This tool supports a useful draft-07 subset: type, required, properties, minLength, maxLength, pattern, minimum, maximum, enum, const, items, minItems, maxItems, uniqueItems, allOf, anyOf, and not.

The type tree shows the data type of every value in your JSON — string, number, boolean, null, object (with key count), or array (with length). It is useful for quickly understanding the shape of an API response or data file without reading all the values. Nested objects and arrays are shown indented, up to 4 levels deep.

No. All processing — validation, schema checking, type inspection, syntax highlighting — runs entirely in your browser using JavaScript. Your JSON never leaves your device, making it safe to use for API responses, configuration files, tokens, or any data you would rather not send to an external service.

Related Tools

View all →