JSON Validator
Validate JSON live — a precise line:column code-frame on the error, a structure summary, and optional lenient mode.
About this ToolHow it works, benefits & use casesTap to collapse
The JSON Validator checks whether your JSON is syntactically valid and, when it is not, tells you exactly where the problem is. Paste JSON and it parses it live, showing a green "Valid JSON" confirmation or a red error that includes the message, the line and column, and a code-frame snippet with a caret pointing at the offending character. For valid input it produces a structure summary: the root type, total key count, maximum nesting depth, and the number of objects and arrays, plus the byte size. A "Lenient (repair)" toggle accepts non-strict input — comments, trailing commas, single-quoted strings, and unquoted keys — and repairs it before validating, flagging when a repair was applied. Two example buttons let you load a clean sample or a deliberately broken one to see the error reporting in action. Everything runs in your browser with no upload, and it is free to use.
How to Use
- 1Paste your JSON into the input panel, or use "Load example" for a valid sample or "Broken sample" to see error reporting.
- 2Optionally enable "Lenient (repair)" in Options to accept comments, trailing commas, or single quotes.
- 3Validation runs live; click "Validate JSON" to confirm the result.
- 4On success, read the "Valid JSON" banner and review the structure summary (root type, keys, depth, objects, arrays, bytes).
- 5On failure, use the code-frame error with its line:column and caret to locate and fix the syntax problem.
Key Benefits
- Pinpoints errors with a precise line:column and a caret in a code-frame snippet
- Structure summary: root type, total keys, max depth, object/array counts, and byte size
- Lenient mode repairs comments, trailing commas, single quotes, and unquoted keys
- Shows when input was repaired before validating
- Built-in valid and broken samples to demonstrate both outcomes
- Live validation updates as you type
- Runs entirely in the browser — JSON is never uploaded
Common Use Cases
- Finding the exact location of a syntax error in a large JSON payload
- Validating an API response or config file before using it
- Cleaning up a hand-edited JSON snippet with lenient repair, then confirming it parses
- Inspecting the depth and key count of an unfamiliar JSON document
- Demonstrating common JSON mistakes (missing commas, trailing commas) to a teammate
Options
Accept comments / trailing commas / single quotes
0 characters · live
Was this tool helpful?
Share Your Experience
Help others discover this tool!
Related tools
- Package.json GeneratorBuild a complete package.json with framework presets, scripts, deps, exports map, engines, and live validation
- Code Block FormatterFormat code blocks for Markdown
- GraphQL Schema ValidatorValidate GraphQL schema definitions
- JSON Path FinderFind and test JSON paths
- Railway Config GeneratorBuild railway.json or railway.toml — build/deploy, restart policy, healthcheck, replicas, region, nixpacks — with a format toggle and audit
- Twitter Card ValidatorValidate Twitter Card meta tags
When parsing fails, the validator reports the error message along with a 1-based line and column and renders a code-frame: the offending source line with a caret (^) beneath the exact column. This makes it easy to jump straight to a missing comma, an extra brace, or an unterminated string.
For valid JSON it shows the root type (object, array, etc.), the total number of keys counted across the whole document, the maximum nesting depth, how many objects and arrays it contains, and the byte size of the input. It is a quick way to understand the shape of an unfamiliar document.

