JSON Validator
Paste JSON and find out immediately whether it is valid. Invalid documents get the reason, the line and column, and a caret under the exact character that broke the parse.
JSON ToolsHow to use JSON Validator
- Paste the JSON you want to check into the panel.
- The verdict appears above it as you type: Valid JSON or Invalid JSON.
- For a valid document you also get the root type, the total number of keys and the nesting depth.
- For an invalid one, read the explanation, then use Jump to error to place the cursor on the exact character.
- Use Copy formatted to take away a tidy, indented copy once the document parses.
Features
- Instant verdict as you type, with no button to press
- Plain-English explanations instead of raw parser messages
- Exact line and column, with a caret under the offending character
- Jump to error moves the cursor straight to the problem
- Summary of valid documents: root type, total keys and nesting depth
- Built-in valid and invalid examples to test against
- Autosaves your draft to this browser only
- Runs fully client-side: your JSON is never uploaded
What makes JSON valid?
JSON is a small format with strict rules. A document contains exactly one top-level value, and that value may be an object, an array, a string, a number, true, false or null. Anything after it — even a stray character — makes the document invalid.
Inside objects, every key must be a string wrapped in double quotes, followed by a colon and a value. Members are separated by commas, and the last member must not be followed by one. Strings use double quotes only, and any double quote, backslash or control character inside them must be escaped.
- Double quotes only
- Both keys and string values must use double quotes. Single quotes and unquoted keys are JavaScript object syntax, not JSON.
- No trailing commas
- A comma may only separate two members. One before a closing brace or bracket is invalid, even though most JavaScript engines accept it in source code.
- No comments
- JSON has no comment syntax. // and /* */ belong to JSONC or JSON5, which are separate formats.
- Numbers are plain
- No leading zeros, no leading plus sign, no hex, no NaN and no Infinity. A decimal point must have digits on both sides.
- One root value
- Two objects side by side are two documents, not one. Wrap them in an array if you need both.
Common JSON errors, and what they mean
- Trailing comma before } or ]
- By far the most frequent error, usually left behind after deleting the last property or array item.
- Missing comma between members
- Two values in a row with nothing between them. The parser reports the position of the second one.
- Unterminated string
- A closing double quote was forgotten, so the parser treats the rest of the file as part of the string and reports an unexpected end of input.
- Single quotes around keys or values
- Valid JavaScript, invalid JSON. Replace them with double quotes.
- Invalid escape sequence
- Only \" \\ \/ \b \f \n \r \t and \uXXXX are allowed. A lone backslash, or something like \x41, fails.
- Raw newline inside a string
- Literal line breaks are not permitted inside a JSON string; they must be written as \n.
- Unexpected content after the value
- Something follows the top-level value — often a second document, a stray bracket, or a log line copied along with the payload.
Frequently asked questions
- What counts as valid JSON?
- A document with exactly one top-level value that follows the JSON grammar: double-quoted keys and strings, no trailing commas, no comments, and plain numbers. The value itself may be an object, array, string, number, boolean or null.
- Is a bare string or number valid JSON?
- Yes. Since RFC 7159 any JSON value may be a complete document, so "hello", 42, true and null all validate. Some older tools only accept an object or array at the root, so check what your consumer expects.
- Will this tool fix my JSON for me?
- No, and that is deliberate. Repairing broken JSON means guessing what you meant, and a wrong guess silently corrupts data. The validator tells you exactly what is wrong and where, and leaves the edit to you.
- Why does my file fail when my editor shows no error?
- Editors often display JSONC or JSON5, which allow comments and trailing commas. They are convenient, but a standard JSON parser rejects them. Anything you send to an API must be plain JSON.
- Does it validate against a schema?
- Not yet. This tool checks syntax: whether the document parses at all. Validating a document against a JSON Schema — required fields, types, ranges — is a separate job and a candidate for a future tool.
- Is my JSON uploaded anywhere?
- No. Validation runs in your browser with the native JSON parser, so nothing is transmitted. That makes it safe to paste real API responses and configuration files.
- Why is the reported column slightly off?
- Browsers report the character offset where the parse failed, which is where the parser gave up rather than where the mistake was typed. A missing comma, for example, is reported at the start of the next value. The caret shows the reported position; the cause is usually just before it.
Related tools
About JSON Validator
JSON Validator is part of JSON Tools on ToolHive, a growing collection of small, focused utilities for developers, designers and students. Format, validate, minify and convert JSON with instant feedback as you type. Everything runs client-side, so your data never leaves the browser tab — which makes these tools safe to use with work-in-progress code and private content.