JSON Validator

Paste JSON to check for syntax errors. Shows exact line and column of any issue.

Input JSON
1
Validation Result
Paste JSON on the left to validate it
2sp · UTF-8

What is a JSON Validator?

A JSON validator checks your JSON text against the official JSON specification (RFC 8259) and tells you whether it is valid or not. If it finds a problem it tells you exactly which line and column the error is on, so you can fix it without guessing.

Common JSON Errors

Missing comma between properties

Invalid

{ "name": "Ravi" "age": 28 }

Valid

{ "name": "Ravi", "age": 28 }
Trailing comma after last property — valid in JS, not in JSON

Invalid

{ "name": "Ravi", }

Valid

{ "name": "Ravi" }
Single quotes — JSON requires double quotes

Invalid

{ 'name': 'Ravi' }

Valid

{ "name": "Ravi" }
Unquoted key — all keys must be quoted strings

Invalid

{ name: "Ravi" }

Valid

{ "name": "Ravi" }
undefined is not valid JSON — use null

Invalid

{ "value": undefined }

Valid

{ "value": null }

Validate JSON in Code

JavaScript:

js
try {
  const data = JSON.parse(jsonString);
  console.log("Valid:", data);
} catch (e) {
  console.error("Invalid JSON:", e.message);
}

Python:

python
import json
try:
    data = json.loads(json_string)
    print("Valid:", data)
except json.JSONDecodeError as e:
    print(f"Invalid: {e.msg} at line {e.lineno}, col {e.colno}")

Node.js (from file):

js
const fs = require("fs");
try {
  const data = JSON.parse(fs.readFileSync("data.json", "utf8"));
  console.log("Valid");
} catch (e) {
  console.error("Invalid:", e.message);
}

Features

Live validation

Validates as you type — no button press needed

Exact location

Shows the exact line and column of every error

Clear messages

Error messages explain what went wrong in plain English

File size stats

Shows byte count and line count when JSON is valid

Frequently Asked Questions

Common causes: missing commas between properties, trailing commas, single quotes instead of double quotes, unquoted keys, and using undefined or NaN (not valid JSON values — use null instead).

The basic validator checks JSON syntax (RFC 8259). For JSON Schema validation (checking structure and types), use the formatter's tree view to inspect your data structure.

Yes. Validation happens entirely in your browser using JavaScript's native JSON.parse. Your data is never sent to any server.

Syntax is valid but the API may reject it for schema reasons — wrong field names, wrong types, or missing required fields. Validation only checks syntax, not business rules.

Related Tools