When an API returns 400 Bad Request or a deploy pipeline dies on a config file, the actual cause is usually one character in one line of JSON, and finding it by eye in a 900-line document is a miserable way to spend an afternoon. This validator does one job: it parses your JSON strictly and, if the syntax is broken, tells you the exact line and column where parsing stopped. It does not reformat, repair, or guess. You paste, you get a verdict, you fix the real problem.
The single-error design is a feature, not a limitation. JSON parsers stop at the first syntax violation they meet, and every error after the first is unreliable anyway — a missing closing brace early in a document makes the parser misinterpret everything downstream, producing a cascade of phantom complaints about lines that are perfectly fine. Report the first error, fix it, re-validate, and repeat. Three quick passes usually finish what an hour of staring cannot.
Validation runs entirely in your browser, so it is safe for payloads with credentials, personal data, or anything else you would not paste into an unknown web service. No upload, no account, works on mobile.
What Counts as Invalid JSON
JSON's grammar is tiny and strict, which is why the same handful of mistakes account for nearly every failed validation. The table below lists the offenders, an example of each, and where they typically sneak in:
| Error | Invalid example | Common source |
|---|---|---|
| Trailing comma | {"a": 1, "b": 2,} | Editing by hand, deleting the last item |
| Single quotes | {'name': 'Ada'} | Copying from Python or JavaScript code |
| Unquoted keys | {name: "Ada"} | Pasting from a JS object literal |
| NaN / Infinity | {"score": NaN} | Serializing JavaScript numbers carelessly |
| Comments | { // config } | Confusing JSON with JSON5 or config formats |
| Smart quotes | {"name": "Ada"} with curly quotes | Pasting from chat apps or word processors |
Trailing commas deserve special mention because they are the number one offender in practice. JSON forbids a comma after the final member of an object or array, even though JavaScript itself has allowed them since 2017. If you maintain a config file by hand, every edit that removes the last item of a list leaves one behind, and the validator will point at the closing bracket rather than the comma — remember that the reported column marks where parsing gave up, and the stray comma is usually one or two characters earlier.
NaN is its own trap. NaN and Infinity are legal JavaScript values but not legal JSON numbers, and some home-grown serializers emit them anyway. If your validator flags NaN, the producing code needs a fix, not the data: decide whether the value should be null or omitted entirely, because there is no JSON representation for an undefined number.
How to Use It (Step by Step)
- Paste the JSON you suspect is broken. If it parses cleanly, the tool tells you so immediately and you can stop looking here.
- On failure, read the reported line and column. Line 1, column 1 is the very first character; editors and this tool count the same way.
- Go to that position in your text and look slightly before it: the culprit is usually the token just prior, such as the comma or quote before the character the parser choked on.
- Fix exactly that one error. Resist fixing several things at once, because a cascade of phantom errors will reshuffle after each fix anyway.
- Re-validate. Repeat until you get a clean pass. For a badly corrupted document, expect two to four rounds.
- Once valid, the document is guaranteed parseable by any standards-compliant consumer — API gateway, CI step, or application code.
How Line and Column Are Calculated
Under the hood, the browser's JSON parser stops at the first violation and reports a character offset into your text. The validator converts that offset into a line and column: newlines encountered before the offset increment the line counter, and the column is the distance from the last newline, counting from column 1. A multi-line paste behaves exactly like a file in your editor — if you saved the same text to disk and ran a strict parser on it, you would get the same position.
Two honest caveats about what the position means. First, it marks where the parser gave up, not necessarily where your mistake lives. A missing closing brace on line 40 can surface as an error on line 87, where the document actually ends; a stray character inside a string can shift everything after it. Second, the position refers to the text exactly as pasted, including any blank lines you may have added around it. If you paste with a leading newline, every reported line will be one higher than in the original file, which occasionally confuses people cross-referencing an editor.
A worked example. Paste this four-line document:
- Line 1:
{ - Line 2:
"service": "billing", - Line 3:
"retries": 3, - Line 4:
"timeout": 5000,
The error is reported at or near the end of line 4: the parser consumed the comma after 5000, expected another key or the closing brace, and hit end of input. The fix is deleting the final comma, and the reported column lands right around that comma's neighborhood. After removing it, the next validation passes instantly.
The API Debugging Workflow
Validation earns its keep in three recurring API situations. Before blaming your code, validate the raw response body: a surprising share of "my client library is broken" reports are actually a proxy error page, an HTML login redirect, or a server stack trace that merely looks like JSON because it starts with a brace. Validate before you parse, and you will never chase a phantom bug again. Before sending a request, validate the payload you built programmatically — a serializer bug, a template typo, or an accidentally stringified object shows up in seconds. And when a third party hands you a webhook definition or an import file, validate it before wiring it into anything, because vendors ship invalid JSON more often than anyone admits.
One more production habit: treat validation as a gate in local tooling rather than eyeballing output in a terminal. Paste, verify, ship — the two seconds it takes beats a failed deploy, and because nothing leaves your machine, there is no reason to hesitate even with sensitive payloads.
Validator vs Formatter vs Linter
These three roles get blurred, so here is the honest boundary. A validator answers one question: does this text parse as JSON, and if not, where did parsing stop? A formatter assumes valid input and changes its presentation. A linter goes further, flagging stylistic issues such as inconsistent indentation or keys that are technically fine but suspicious. This tool is deliberately the first kind only. That focus keeps the error reporting sharp and avoids the trap of "fixing" documents silently — a tool that repairs JSON for you will occasionally repair it into something you did not mean, and you will ship the result. Strict pass or strict failure, nothing in between, is the behavior you want when a document is about to be consumed by a machine that will be just as strict.
Tips and Best Practices
- Validate after every hand edit to a config file. The trailing-comma mistake reappears the moment you get interrupted mid-edit.
- When the error position seems wrong, look for an unclosed bracket much earlier in the file; the report marks where the parser collapsed, not the root cause.
- If your JSON contains numbers you copy from spreadsheets, check for thousands separators like
1,234inside values — the comma can masquerade as a syntax error one level up. - Paste the exact bytes, not a retyped version. Fixing "obvious" typos before validating hides the real error and can introduce a second one.
- For files with secrets, validation here is safe since parsing is local; still, prefer keeping secrets in environment variables rather than in the JSON itself.