JSON Validator
Validate and format JSON data instantly with this free client-side JSON validator tool. Check JSON syntax, detect errors, and beautify JSON directly in your browser.
Loading tool…
What makes JSON valid or invalid
JSON's specification (RFC 8259) is strict in ways that surprise people, largely because it looks like JavaScript but is not JavaScript. Keys must be double-quoted strings — no single quotes, no bare identifiers. Trailing commas after the last element are forbidden. Comments do not exist. Numbers cannot have leading zeros or hexadecimal notation. NaN and Infinity are not values. The whole document must be a single value, and it must be UTF-8.
A validator parses the text against that grammar and reports the first place it breaks, with a line and column. This matters because the failure downstream is usually cryptic: a config file that will not load, a deployment that fails with a stack trace pointing at a parser, or an API returning 400 with no explanation. Validating the document first turns a mysterious failure into a specific one-character fix.
Why we built this tool
Hand-edited files are where invalid JSON comes from — a package manifest, a CI pipeline definition, a cloud policy document, a translation file. One stray comma and everything stops.
Those same files often carry credentials, internal hostnames, and infrastructure detail. Checking them should not involve uploading them anywhere, so our validator runs the parse in your browser with no network call at all. Your document stays in the tab, the error report is generated locally, and nothing is stored. That also makes it fast enough to use as a reflex — paste, check, fix — and usable offline while you are working on a plane or inside a restricted network.
Tips and common mistakes
- JSON has no comments; a
//line copied from a JavaScript file will always fail validation. - Duplicate keys are technically permitted by the grammar but most parsers silently keep the last one, which hides real bugs.
- Check the file's encoding if validation fails on a document that looks perfect — a byte order mark at the start breaks strict parsers.
- Numbers with leading zeros, hexadecimal literals, NaN, and Infinity are all invalid, however reasonable they look.
Open JSON Validator with a link
JSON Validator can be handed its input by the link that opens it, so the page arrives with the work already done. This is meant for assistants and scripts: if a chatbot, an editor extension, or a command-line agent already holds your content, it can build a link instead of asking you to copy and paste into a box.
The payload rides in the fragment — the part of a URL after the #. Browsers never send the fragment to a server, so anything handed over this way stays on your device exactly as a dropped file would. A link that uses the query string instead is rewritten into the fragment by the page before any analytics or ad script can read the address.
Prefix any field with gz — #gztext= — to pass it as gzip-compressed base64url, which fits roughly five to ten times more into the same link. Links stay reliable up to about 8,000 characters; past that, chat apps and address bars start truncating them, and the page says so rather than loading half a document.
One exception to the privacy rule: ?url= tells the page to download the input from an address. That request goes from your browser straight to that server — not through ours — but it does leave your device, and it only works if the server allows cross-origin requests.
#text=— the text to work on#json=— the JSON document
Example: https://mygadgets.ink/tools/json-validator/#text=...&json=...
Quick start: using JSON Validator
- Paste the JSON you want to check into the input above.
- Run the validation; valid documents are confirmed immediately.
- If it fails, read the line and column in the error message and jump to that spot.
- Fix the usual suspects first: trailing commas, single quotes, unescaped quotes inside strings.
- Re-validate until it passes, then copy the corrected document back where it belongs.
Once it is valid, JSON Formatter makes it readable, and JSON to YAML converts it for tools that prefer YAML.