Skip to content
Sealpaste

Delete all recent work?

This removes the 0 items saved in this browser. Your settings stay.

Stop saving recent work?

New work won't be saved in this browser. The 0 items already saved can stay or go.

JSON Validator

Input

Paste JSON to check, or

CtrlV paste · Ctrl↵ run now

Result
Ready
Ln 1, Col 1
Runs in your browser. Nothing you paste is uploaded unless you share it.

Check JSON and find the exact line of the error

Paste JSON to check it. Valid JSON is confirmed with its size and value count; JSON that isn’t valid shows where it breaks and why.

How to use it

  1. Paste the JSON you want to check, or open a file.
  2. The check runs as you paste: the status bar says Valid JSON, or Not valid JSON with the line and column.
  3. Read the reason and the lines around it, then press Show in input to put the cursor on the spot.
  4. Fix it and the check runs again as you type.
  5. Checking JSONC or JSON5? Pick it above the editor: that standard’s comments, trailing commas and other forms are then allowed, and the result is shown as JSON.

Examples

Missing comma

Input
{
  "name": "api"
  "port": 8080
}
Result

Line 3, column 3Expected "," or "}" but found the string "port"

The error points at the start of the line after the missing comma.

Trailing comma

Input
{"items": [1, 2, 3,]}
Result

Line 1, column 19Trailing comma before "]" is not allowed in JSON

Python-style literal

Input
{"enabled": True}
Result

Line 1, column 13"True" is not valid JSON; use true, false or null

Common JSON errors and how to fix them

Most invalid JSON comes from JavaScript or Python habits. These are the messages you will see, what causes each and the fix:

  • Expected "," or "}" but found the string "port": a comma is missing between two properties. Add one at the end of the line before.
  • Trailing comma before "]" is not allowed in JSON: there is a comma after the last item, as in [1, 2, 3,]. Delete it.
  • Expected a property name in double quotes but found "'": a key in single quotes or with no quotes. Write "name", not 'name' or name.
  • Comments are not allowed in JSON: // and /* */ belong to JSONC and JSON5, not JSON. Remove them.
  • "True" is not valid JSON; use true, false or null: Python’s True, False and None, and JavaScript’s NaN and undefined, are not JSON. Use true, false or null.
  • Line break inside a string; use \n instead: a string can’t run over two lines. Write \n where the break should be.
  • Invalid number "00": a number can’t start with a zero, as in 007. Write 7, or "007" as a string.
  • Unexpected "{" after the end of the JSON value: two documents were pasted together. Put them in an array, or check one at a time.
  • Expected a property name in double quotes but found "“": curly quotes, which word processors and chat apps put in. Replace them with straight " quotes.
  • Expected a value but found U+00A0 (a space JSON doesn’t allow: only space, tab, CR and LF): a non-breaking space, often copied from a web page or a document. Replace it with a plain space.

What the validator checks

It follows the JSON standard, RFC 8259: one value per document, strings and keys in double quotes, no comments, no trailing commas, no leading zeros, and control characters escaped inside strings.

It reports the first place where the text stops being JSON. After that point a parser can only guess what was meant, so fix it and the check runs again to find the next one.

The messages are the same in every browser, because the parser is part of this page instead of the browser’s own JSON.parse.

JSONC is JSON plus // and /* */ comments and trailing commas, as VS Code reads its settings. JSON5 follows its 1.0.0 specification: on top of that, keys without quotes, strings in single quotes that may continue over a line with \, hex numbers, a leading + or decimal point, Infinity and NaN. Shown as JSON, numbers keep every digit (hex is converted exactly) and Infinity and NaN become null, since JSON has no way to write them.

When text isn’t JSON but is valid JSONC or JSON5, the error says so.

Sources: RFC 8259: The JSON Data Interchange Format, The JSON5 Data Interchange Format 1.0.0

Questions

Is my JSON uploaded?
No. Everything runs in your browser, so your JSON stays on your device. Nothing you paste is uploaded unless you share a result, which is locked with your password first. That matters when you check an API response or a config file that holds keys.
Why does it show only one error?
After the first error the parser can’t tell what was meant, so further messages would mostly be wrong. Fix the first one and the check runs again.
Is JSON with comments valid?
Not as JSON: standard JSON has no comments. JSONC (used by VS Code settings) and JSON5 allow them, and they are different formats. Pick JSONC or JSON5 above the editor to check a file in that format; with JSON picked, an error in text that one of them reads says which.
Are duplicate keys an error?
No. The standard says keys should be unique but doesn’t make duplicates invalid, so the validator accepts them. JavaScript’s JSON.parse and Python’s json module keep only the last value, so it is worth removing them.
Can it fix my JSON for me?
The validator doesn’t change your text: it names the first error and puts the cursor on it. The JSON Formatter ’s Repair switch does fix it: quotes, commas, comments, unquoted keys and Python values, with every change listed by line.
Does it check fields against a JSON Schema?
No. It checks that the text is well-formed JSON, not that it has the fields or types an API expects. For that, use the JSON Schema validator .

Related tools