JSON Validator
Find every JSON problem, with the exact line to fix.
About the JSON Validator
What is a JSON validator?
A JSON validator checks whether a document follows the JSON specification exactly — because parsers don't forgive. One trailing comma, one single-quoted string, or one stray comment and your API request fails, your config is ignored, or your import silently breaks. This tool parses your JSON live as you type and pins every problem to its exact line and column, with a small code frame showing precisely where the parser gave up.
It also catches what a plain parser can't tell you. Duplicate keys are legal-looking but dangerous — JSON.parse silently keeps only the last one — so this validator flags every duplicate with both line numbers. And when your input is "almost JSON," it recognizes the usual suspects by name: trailing commas, single quotes, unquoted keys, comments, NaN, and even smart quotes pasted from a chat or document, each with a clear hint on how to fix it. Everything runs in your browser; nothing is uploaded.
How to Use This Tool
- Add your JSON. Paste it into the left editor, click Open file, or try the Valid and Broken samples.
- Read the badge. Green means no issues; red or amber shows the error and warning counts.
- Click any result. The editor jumps to the exact line and column so you can fix it immediately.
- Re-check instantly. Validation re-runs as you type, so the list shrinks as you clean up.
Common Use Cases
- Debugging API payloads: Find out exactly why a request body or webhook response fails to parse.
- Checking config files: Validate package.json-style files after hand-editing them.
- Cleaning exported data: Catch duplicate keys and near-JSON syntax in data dumped from other tools.
- Converting from JavaScript: Turn relaxed object literals into strict JSON with guided fixes.
Once it's valid, the JSON Formatter pretty-prints it, the JSON Minifier compacts it, and the JSON Compare tool diffs two documents. Or browse all our free developer tools.
Frequently Asked Questions
Why does it flag duplicate keys when my JSON parses fine?
Because duplicate keys are where data silently disappears. The JSON spec doesn't forbid them, but virtually every parser keeps only the last value, so an earlier value you meant to send simply vanishes. The validator shows both line numbers so you can decide which one should survive.
What's the difference between errors and warnings here?
Errors mean the document does not parse — the parser's own message is shown with its exact position. Warnings parse or would parse after an obvious fix: duplicate keys, trailing commas, comments, single quotes, unquoted keys, and similar near-JSON habits carried over from JavaScript.
Why is only one syntax error shown at a time?
JSON parsers stop at the first structural error, and guessing beyond it produces noise rather than help. Fix the first error and the validator instantly re-checks — the hint warnings, which don't depend on parsing, are all listed at once.
Does it handle big files and long integer IDs?
Yes. Validation is read-only, so nothing is reformatted or rounded — an 18-digit ID stays exactly as written. Files up to several megabytes validate in a few hundred milliseconds in the browser.
What are the stats chips above the results?
Size, line count, total key count, and nesting depth. The depth chip is handy for spotting accidentally double-wrapped payloads — if a simple object reports depth 5, something upstream is nesting too much.
Is my JSON uploaded anywhere?
No. Validation runs entirely in your browser with self-contained JavaScript — no CDN, no server round trips, no logging. It even works offline once the page has loaded.