1
OneClickUse
Converters Tool

JSON Validator

Validate JSON, see parse errors, and copy formatted output.

Privacy-first workflows
Fast and simple
100% Free, no signup
Valid JSON
6 values / keys checked

Written by Anil Gautam · Updated

How do you read a JSON parse error?

The validator hands your text to the browser's built-in JSON.parse. When that fails, the status panel shows the browser's own message, so Chrome, Firefox and Safari word the same error differently. Chrome and Edge give a character position counted from 0 plus a line and column counted from 1. In Chrome an empty box gives Unexpected end of JSON input, and a string value broken across two lines gives Bad control character in string literal, because a line break inside a string has to be written as \n.

The reported spot is where the parser gave up, which is often just past the real mistake. Take an object indented by two spaces, with "a": 1 on line 2, "b": 2 on line 3 and no comma between them. Chrome reports Expected ',' or '}' after property value at line 3 column 3, which is where "b" starts, while the missing comma belongs at the end of line 2. Single-quoted keys fail at the first quote, so {'a': 1} stops at line 1 column 2. Data copied from Python fails at True or None, which JSON spells true and null. A number written with a thousands separator, as in "total": 1,234, fails because the comma ends the value and 234 is not a quoted key.

What does a valid result tell you?

Valid means the text follows JSON syntax. Any single JSON value counts, so 42, "hello" or null on its own passes. The counter adds up keys and values: the sample in the input box has three keys and three values, so it reports 6 values / keys checked. Array items are counted twice, once as positions and once as values, so [1, 2, 3] also reports 6, and an empty {} reports 0.

Some problems still pass. JSON.parse accepts duplicate keys and keeps the last one, so {"a": 1, "a": 2} is reported as valid and the formatted output shows only "a": 2. Integers with more than about 16 digits can be rounded in the formatted copy: 1234567890123456789 becomes 1234567890123456800. The formatted output uses two-space indentation, and the Copy button copies it, or the error text when the input is invalid. To shrink valid JSON, use the JSON Minifier, and for JSON that will not parse, the JSON Formatter & Toolkit has a Repair button.

How it works

How to validate JSON

STEP 01
Paste your JSON into the input box.
STEP 02
Read the valid or invalid status instantly.
STEP 03
Copy the formatted JSON output when it is valid.
Learn more

Related guides

You might also need

Related tools

Converters
JSON Formatter & Viewer Online
Format and validate JSON, explore a collapsible tree, search keys and values, compare structures, and export conversions. Your JSON stays in your browser.
Use now
Converters
CSV to JSON
Convert simple CSV rows into JSON objects using the first row as headers.
Use now
Converters
JSON to CSV
Convert an array of JSON objects into CSV rows with headers.
Use now
Converters
RGB to HEX Converter
Convert HEX colors to RGB or RGB colors back to HEX.
Use now
Converters
Unix Timestamp Converter
Convert Unix timestamps to readable dates and dates back to Unix time.
Use now
Converters
Text to Binary Converter
Convert readable text to binary bytes or binary back to text.
Use now
FAQ

Common questions