{}JSON FYI
JSON Validator

Validate JSON online

Strict, fast, private. Pinpoint errors with line and column, get hints for common mistakes, and confirm conformance to the JSON specification.

Ready when you are.

Paste JSON on the left, or click Sample to try a quick example. Validation runs as you type — entirely in your browser.

EmptyType: Nodes: 0Depth: 0Size: 0 B

What 'valid JSON' means

A valid JSON document follows RFC 8259: a single root value (object, array, string, number, boolean, or null), double-quoted strings and keys, no comments, no trailing commas, and finite numbers in standard notation.

Many "JSON-like" formats relax these rules — JSON5 allows comments and trailing commas, JSONC adds comments only. JSON FYI validates strict JSON so the data round-trips through any compliant parser.

Examples

Trailing comma
Input
{
  "a": 1,
  "b": 2,
}
Output
Error · line 4, col 1
Unexpected '}' — trailing comma after value
Single-quoted keys
Input
{ 'name': "Ada" }
Output
Error · line 1, col 3
Keys must be double-quoted strings
Multiple root values
Input
{"a":1}
{"b":2}
Output
Error · line 2, col 1
A JSON document must have exactly one root value

Use cases

From the JSON FYI guides

In-depth explanations for common JSON errors and patterns.

Frequently asked questions

What does this validator check?+

RFC 8259 conformance: balanced brackets, double-quoted keys and strings, valid escape sequences, valid numbers (no leading zeros, no NaN/Infinity), no trailing commas, no comments, and a single root value.

How precise are the error locations?+

Errors include the exact line and column of the first invalid token, plus a 5-line context snippet with a caret pointer.

Is my input uploaded anywhere?+

No. Validation runs in your browser. Nothing is sent to a server.

Does it support JSON Schema?+

This page focuses on syntax. JSON Schema (structural validation) is handled separately by libraries like Ajv — let us know if you'd like a built-in schema validator.

Validate JSON in code

Drop these snippets into pre-commit hooks, CI, or smoke tests.

Validate JSON syntax in a script

Exit non-zero if the file isn't valid JSON. Drop into pre-commit hooks or CI.

node validate.js data.json
import { readFileSync } from "node:fs";

try {
  JSON.parse(readFileSync(process.argv[2], "utf8"));
  console.log("valid");
} catch (e) {
  console.error("invalid:", e.message);
  process.exit(1);
}
Input
{ "a": 1, "b": 2, }
Output
invalid: Unexpected token } in JSON at position 18
exit code: 1

Other JSON tools on JSON FYI

Every flow you need — formatter, validator, viewer, pretty print, repair, and the full workbench.

Related tools & guides