JSON Tools
JSON Validator
Check JSON syntax and see clear parser errors in your browser.
Input stays in this browser while you use the tool.
About this tool
The JSON Validator checks whether a piece of text is valid JSON. Paste your data, run the tool and it tells you whether the text can be parsed. If it cannot, the tool shows an error message that points to the problem so you can correct it.
"Valid" here means the text follows the JSON syntax rules: keys and strings use double quotes, items are separated by commas, brackets and braces are balanced, and only the allowed value types appear (objects, arrays, strings, numbers, true, false and null). This is a syntax check. The tool does not know what your fields should be called or which values your application expects.
A validator is useful because most JSON problems are small: a trailing comma, a missing quote or a stray character copied from a web page. Finding one wrong character by eye in a long payload is slow, while a parser can usually point to it at once.
The validation runs in your browser, so the text you paste is checked on your own device and is not sent to the BitToolsKit server.
Use cases
- Check a payload before sending it. Validate a request body first, so you know a failed API call is not caused by broken syntax.
- Verify a configuration file. Files such as
package.json,.eslintrcor app settings stop working if a single comma is wrong. - Test data produced by a script. JSON built by joining strings together in code often ends up with a missing quote or a trailing comma. Validate the result before you use it.
- Check data copied from documentation, chat or email. Copying from web pages and word processors can add curly quotes or invisible characters that break parsing.
- Clean up test fixtures and mock data. Confirm every fixture file parses before a test run fails for the wrong reason.
- Learn the JSON rules. Students can paste small experiments and see exactly which rule a mistake breaks.
How to use
- Paste the JSON you want to check into the Input box.
- Click Validate JSON.
- Read the result in the output area. A valid input is reported as valid. An invalid input shows an error message.
- If there is an error, look at the place the message points to, fix the problem and click Validate JSON again. Repeat until the JSON is reported as valid, because a parser stops at the first error it finds.
- Use Copy output or Download to keep the result, and Clear to start again with new data.
The wording and the position numbers in an error message come from your browser's JSON parser, so they can differ between Chrome, Firefox and Safari. The cause of the problem is the same.
Examples
Example 1: Valid JSON
Input:
{"user":"ada","tags":["dev","admin"],"active":true}Output: The JSON is valid. No error is reported.
Example 2: Single quotes
Input:
{'name': 'Ada'}Output:
An error message appears. The parser stops at the first single quote, near the start of the text. Replace the single quotes with double quotes: {"name": "Ada"}Example 3: Missing comma
Input:
{"a": 1 "b": 2}Output:
An error message appears. The parser finds a string where it expected a comma or a closing brace. Add a comma after 1: {"a": 1, "b": 2}Example 4: Two JSON values in one input
Input:
{"id":1}
{"id":2}Output:
An error message appears, because the text holds two separate JSON values. This layout is called JSON Lines. Validate each line on its own, or wrap the items in an array: [{"id":1},{"id":2}]Common errors
Message about an "unexpected token" near the start of the text
Check the first characters. The usual causes are single quotes, an unquoted key, a label such as Response: in front of the JSON, or an invisible character copied with the text. Delete the first few characters and retype them.
Message about "unexpected end of JSON input"
The input is empty or cut off. Look for a missing closing } or ] at the end, or a partial copy that stopped in the middle of the data.
Message that mentions a comma, or says a property name was expected
A trailing comma after the last item, or a missing comma between two items. Check the characters just before the position the message gives.
Message about non-whitespace characters after the JSON
The text contains more than one JSON value, or extra text after the closing bracket. For JSON Lines, validate one line at a time. Otherwise delete the extra text or put the items into an array.
Message about a bad control character or an unterminated string
A raw line break or tab sits inside a string. Replace it with the escape sequences \n or \t, and make sure every string has a closing double quote.
JSON that has comments in it
Standard JSON has no comments, so lines starting with // or blocks in /* */ are errors. Remove them, or use a format such as JSONC or JSON5 in your own tools.
Numbers like 007, +5, .5 or 5.
JSON numbers cannot have leading zeros or a plus sign, and need digits on both sides of a decimal point. Write 7, 5, 0.5 and 5.0 instead.
Python or JavaScript values such as True, False, None, undefined or NaN
JSON uses lowercase true and false, and null for missing values. undefined and NaN do not exist in JSON. Replace them before validating.
Invisible characters, such as a byte order mark or a non-breaking space
These can come from files saved by some editors or text copied from web pages. If the message points to position 0 or a place where nothing looks wrong, retype that part by hand or paste the text through a plain-text editor first.
The JSON is valid but your application still rejects it
A validator only checks syntax. The application may expect different field names, a different type for a value or a required field that is missing. Compare the data with the API documentation or a JSON Schema.
Frequently asked questions
What does a JSON validator check?
It checks that the text follows the JSON syntax rules, so that a parser can read it. That means double-quoted strings and keys, commas in the right places, balanced brackets and only the allowed value types.
Does it check the structure of my data, such as required fields?
No. It checks syntax only. Checking required fields, value types or allowed values needs a JSON Schema validator, which compares the data with a separate set of rules.
What is the difference between the JSON Validator and the JSON Formatter?
The validator gives a yes or no answer and explains the error. The formatter rewrites valid JSON with indentation so that it is easy to read. Validate first when you only want to know whether the data is correct, and use the formatter when you want to read it.
How do I read the position in an error message?
The position is a character count from the start of the input, or a line and column. The real mistake is often just before that point, for example a missing comma after the previous item.
Why is my JSON valid in one tool but not in another?
Some tools accept relaxed formats such as JSON5, which allow comments, single quotes and trailing commas. This validator expects strict JSON. Duplicate keys and very large numbers are also handled differently from tool to tool.
Does it report duplicate keys?
No. Standard JSON parsers, including the one built into browsers, accept an object with the same key twice and keep the last value. Duplicate keys are bad practice, so check your data separately if they matter.
Can I validate JSON Lines or NDJSON files?
Not as one block, because each line is a separate JSON value. Validate one line at a time, or wrap the lines in an array and add commas between them.
Is my JSON uploaded anywhere?
No. The tool runs in your browser and checks the text on your device. As a general habit, avoid pasting passwords, API keys or private tokens into any online tool.
Is there a size limit?
There is no fixed limit, but very large inputs can be slow because all of the work happens in your browser. For files of many megabytes, a command-line tool such as jq is a better choice.