Skip to content
cliplimeClipLime

Check whether your JSON is valid

Paste JSON and see at once if it is valid. If not, you get the line, the column and what is likely wrong. Nothing is uploaded.

Your text is processed in this tab and never uploaded

Options

Read JSONC, as used in config files. It is reported as not standard JSON.

0 characters, 0 lines Your text stays in this tab.

Result

The result appears here.

This checks the JSON syntax, not a schema: it cannot tell you that a field is missing or has the wrong type.

At a glance

What it checks
JSON syntax as defined by RFC 8259: one value, double quoted names and strings, valid escapes, valid numbers.
What it reports
Root type, size, lines, nesting depth, and counts of objects, arrays, property names, strings, numbers, booleans and nulls.
Warnings
Duplicate keys, numbers with more digits than a JavaScript number holds, and unpaired surrogate escapes.
Errors
The line and column, the faulty line with a marker, and a likely cause.
Relaxed option
Reads comments and trailing commas as JSONC, and says the result is not standard JSON.
Not checked
Schemas, field types and business rules.
Privacy
Runs in your browser tab. Your JSON is never uploaded.

How to do it

  1. 1

    Paste JSON or drop a file

    Paste into the left box or drop a .json file on it. The check runs as you type.

  2. 2

    Read the verdict

    A green card says Valid JSON and shows the report. A red card names the problem with its line and column.

  3. 3

    Fix the first error

    Press Go to line to jump to the problem in your text. Fix it, and the verdict updates. Only the first problem is shown, because later ones are often caused by it.

  4. 4

    Switch mode if you need to

    Choose Format to indent the valid JSON or Minify to shrink it.

What validation checks

A JSON document is valid when it follows the grammar in RFC 8259. This validator checks every rule of that grammar:

  • There is exactly one value at the top, and nothing after it.
  • Objects use { } with double quoted names, a colon after each name, and commas between members and no comma after the last.
  • Arrays use [ ] with commas between items and no comma after the last.
  • Strings use double quotes, contain no raw line breaks or tabs, and use only the escapes \" \\ \/ \b \f \n \r \t and \uXXXX.
  • Numbers have no leading zeros, no leading plus sign, and a digit on both sides of a decimal point.
  • The only literals are true, false and null, in lowercase.
  • There are no comments.

Beyond the grammar it adds warnings for things that are legal but risky: duplicate property names in one object (the RFC says names should be unique, and parsers disagree about which value wins), and numbers that a JavaScript program would round.

What a syntax check cannot tell you

Valid JSON is not the same as correct JSON. This tool does not know what your document is supposed to contain, so it cannot tell you that an email field is missing, that age is a string instead of a number, or that an API will reject the request.

To check structure and types you need a JSON Schema and a validator that reads it. Run the syntax check first, because a schema validator cannot start until the text parses.

JSON that works in JavaScript but is not valid JSON

Most invalid JSON is really a JavaScript object literal. JSON came from that syntax but kept a much smaller part of it:

  • Unquoted names, as in {name: "Ann"}, are not allowed. Names need double quotes.
  • Single quoted strings are not allowed.
  • Trailing commas, such as [1, 2, ], are not allowed.
  • Comments are not allowed.
  • undefined, NaN and Infinity are not JSON values.
  • Hex numbers such as 0xFF, and numbers such as .5 or 5., are not allowed.

If your data uses some of these on purpose, it is probably JSONC or JSON5. Turn on the relaxed option to read comments and trailing commas. The result then says it is valid only as relaxed JSON.

Reading the report

The report describes the document you pasted. Nesting depth counts how many arrays and objects are open at the deepest point. Property names counts every key in every object, including repeated ones. Size is the number of bytes the text takes in UTF-8, which is what a file or a request would carry.

A Warnings count above zero does not make the JSON invalid. The notes under the report list each one with its line and column.

Questions people ask

Does this check my JSON against a JSON Schema?

No. It checks the syntax only. A schema validator checks field names, types and ranges against rules you provide. This tool will tell you whether the text is JSON, not whether it is the JSON you meant.

Why is a duplicate key a warning and not an error?

The JSON grammar allows repeated names. RFC 8259 only says names SHOULD be unique and that parsers behave unpredictably when they are not. JSON.parse keeps the last value, and other parsers keep the first or fail. The warning shows where it happens so you can decide.

Why does my JSON with comments fail?

Standard JSON has no comments, so a strict validator reports them. If the file is meant to allow them, as tsconfig.json does, turn on Allow comments and trailing commas. The verdict then says it is valid as relaxed JSON, not standard JSON.

Why does it show only one error?

After the first syntax error the reader cannot know what the author meant, so later messages are often side effects of it. Fixing the first problem and checking again is faster than reading a list of guesses.

Is there a size limit?

Up to 2 million characters the check runs as you type. Larger text waits for the Validate now button so the page stays responsive. The limit after that is your device's memory.

Is my JSON uploaded to check it?

No. The check runs in your browser tab and the text never leaves it.