All Tools

JSON Validator with Line and Column Errors, Free

Check whether your JSON is valid in the browser. Errors name the line and column and show the offending text with a caret. Big numbers are kept as written. Nothing is uploaded.

Layout

Orders object keys alphabetically at every level.

Removes comments and trailing commas before parsing.

0 characters, 0 bytes

0 characters, 0 bytes


About the JSON Validator

The JSON Validator checks whether your text is valid JSON and, when it is not, tells you where it goes wrong. Paste JSON on the left. If it is valid, the note under the result describes what you have: an object or an array, how many keys or items it holds, how deeply it nests and how many bytes it takes. If it is not, an error names the line and column of the first problem and shows the offending line with a caret under the character.

Your JSON never leaves your device. The check runs in the page, so nothing is uploaded, logged or stored. This page opens in Validate only mode; the same tool can also format and minify, using the layout buttons above the input.

How to use it

Steps

  1. Paste or type JSON into JSON.
  2. Read the verdict under the result. Valid JSON with a short description means the text parses.
  3. If you see an error, go to the line and column it names. The caret points at the character where the parser gave up, which is often one character after the real mistake, such as the closing brace after a stray comma.
  4. Fix the text and the verdict updates as you type.

What counts as valid

JSON is stricter than JavaScript object syntax. Keys and strings must use double quotes. There are no comments, no trailing commas, no undefined, no NaN and no hexadecimal numbers. Numbers cannot start with a plus sign or a leading zero, so 007 is invalid while 0.7 is fine. A string cannot contain a raw line break or tab; write \n or \t instead. The only literals are true, false and null, in lower case.

Common errors and what they mean

  • Trailing comma before "}" - a comma follows the last item. Remove it.
  • Strings must use double quotes - 'name' is not valid; use "name".
  • Comments are not allowed - JSON has no // or /* */. Remove them, or turn on Repair if you only want to check the rest.
  • Unexpected end of the input - a bracket, brace or quote is missing at the end.
  • Unknown value - a bare word such as undefined or True; JSON only has true, false and null.

Strict by default

Repair is off, so the validator accepts only real JSON. Turn it on when you are checking a hand-written config file and want to ignore comments and one trailing comma per list; the note then says how many were skipped.

Worked example

The text {"a": 1, "b": [1, 2,]} is invalid. The error reads Line 1, column 21: Trailing comma before "]" and the caret sits under the final comma. After removing it, the note reads Valid JSON: an object with 2 keys, nested 2 levels deep. For a deeper look at a valid document, open it in the JSON Viewer, or tidy it with the JSON Formatter.

Frequently asked questions

Is my JSON uploaded when I validate it?

No. The check runs in your browser and nothing is uploaded, logged or stored. Closing the tab clears the text. Avoid pasting live secrets into any online tool you cannot inspect.

What does the line and column in the error mean?

They point at the first character the parser could not accept, counted from 1. The caret under the shown line marks it. The real mistake is often just before it, for example a missing comma shows up at the start of the next key.

Why are comments and trailing commas errors?

The JSON standard does not allow them. They are common in hand-written config files, so Repair is available to skip them, but it is off by default so that a validation result tells you whether strict parsers will accept the text.

Does it check my JSON against a schema?

No. It checks syntax only: whether the text is well-formed JSON. It does not check that required keys are present or that values have the right types. The note describes what the document contains so you can confirm it is what you expected.

Why is a single-quoted string rejected?

JSON strings and keys must use double quotes. Single quotes are valid in JavaScript but not in JSON, so the error says so and points at the opening quote.

Other related tools