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.
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
{
"a": 1,
"b": 2,
}Error · line 4, col 1 Unexpected '}' — trailing comma after value
{ 'name': "Ada" }Error · line 1, col 3 Keys must be double-quoted strings
{"a":1}
{"b":2}Error · line 2, col 1 A JSON document must have exactly one root value
Use cases
- Pre-deploy config check
Run config files through the validator before they ship to production — catch broken JSON during code review, not at boot time.
- Triage 400 responses
When an API rejects a request body, paste the body here to find the malformed character.
- QA generated JSON
Templated or AI-generated JSON often produces edge cases (smart quotes, comments). Validate before you parse.
- Validate webhooks
Confirm an inbound webhook is actually parseable JSON before you push it through your pipeline.
From the JSON FYI guides
In-depth explanations for common JSON errors and patterns.
What it means at every position — and how to fix it.
Empty string, BOM, HTML response, undefined — the five root causes.
The mistakes that cause 90% of parse failures, with fixes.
JavaScript, Python, and Bash validation snippets.
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.
Exit non-zero if the file isn't valid JSON. Drop into pre-commit hooks or CI.
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);
}{ "a": 1, "b": 2, }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.
Pretty-print with custom indent and sort keys.
Browse JSON as an interactive collapsible tree.
Compare two JSON files structurally with paths.
Convert arrays into spreadsheet-ready CSV.
Well-formed XML with attributes and indenting.
Idiomatic YAML 1.2 for Kubernetes & Compose.
Beautify JSON with JS- or Python-style indent.
Free in-browser formatter — nothing uploaded.
Pinpoint errors with a catalog of common fixes.
Validate data against a JSON Schema — powered by Ajv.
All tools in one editor: validate, format, view, query.