Your webhook fires, your handler runs, and nothing works. The natural move is to open the handler code and start reading. But the handler may be innocent. The payload that arrived from the other system might be malformed, truncated, or structured differently from what the sender's documentation promised, and a handler bug and a bad payload look exactly the same from the outside: silence.

The cheap first move is to check the payload itself. Paste it into the free JSON Formatter and Validator on Ovatly, validate it, and then format it so you can read what actually arrived. This guide walks through that check, including why it is safe to run on payloads that carry customer data.

Contents

  • Quick answer
  • Why the payload is the first suspect
  • What strict validation actually catches
  • How to check a webhook payload, step by step
  • Your payload never leaves the browser
  • Worked example: reading a small payload
  • Limitations and honest tradeoffs
  • Common mistakes
  • FAQs
  • Conclusion
  • References

Quick answer

Copy the raw payload exactly as it arrived and paste it into the JSON Formatter and Validator. Run Validate only first: if the JSON is broken, you get a plain-words error naming the problem, such as an unexpected character or a missing comma. If it validates, format it with a 2 or 4 space indent and read the structure field by field. Everything runs in your browser, so the payload is never uploaded anywhere.

Why the payload is the first suspect

A webhook payload crosses a boundary between two systems, and boundaries are where assumptions go to die. The sender serializes the data with its own library, its documentation drifts from what it actually sends, a new event type adds a field, or a value that used to be a number starts arriving as a string. Your handler was written against the documentation. The payload is the ground truth.

Checking the payload first splits one confusing problem into two clear ones. Either the JSON is malformed, in which case the fix belongs on the sender's side and your handler code is fine, or the JSON is valid and the mismatch lives in the values and field names, which you can then compare against your handler line by line. Both answers save you from rewriting working code on a guess.

What strict validation actually catches

The validator checks your paste against the strict JSON standard, and strict is the operative word. Four things fail that many people expect to pass: trailing commas after the last item, single-quoted strings, unquoted keys, and comments written into the text. Comments deserve a special note, because some tools accept a relaxed format with comments, often called JSONC. This validator does not. It checks real JSON, and real JSON has no comments.

These flaws slip into payloads more easily than you would think. A payload gets assembled by hand in a test, copied out of a log where it was wrapped or edited, or produced by a serializer that is lenient about what it writes. The validator reports the first problem it finds in plain words, naming it directly rather than giving you a position number and a shrug. Validate only checks the text without changing it, so the verdict applies to the payload exactly as it arrived, not to a tidied copy.

How to check a webhook payload, step by step

  1. Copy the payload from your logs or the sender's dashboard, exactly as received. Do not clean it up first; the whole point is to test the real thing.
  2. Open the JSON Formatter and Validator and paste the payload in.
  3. Run Validate only and read the result: either the JSON is valid, or the error names the first problem.
  4. If it is invalid, stop. The named problem is a sender-side or transport issue to raise with the sender, with the payload as evidence. It is not a handler bug.
  5. If it is valid, format it with a 2 or 4 space indent and read through the fields, checking names, nesting and value types against what your handler expects.

Your payload never leaves the browser

Webhook payloads routinely carry other people's data: names, email addresses, order details, sometimes payment references. Pasting one into a typical online checker means uploading it to a stranger's server, where it may be logged, cached, or kept for longer than you would like. That is a real exposure created by a debugging step that felt harmless.

This check has no such exposure. The formatter and validator run entirely in your browser, on your device, and nothing is uploaded. The payload stays where it started. For payloads that carry customer data, that is not a nice extra; it is the difference between a safe debugging step and one you would have to explain later.

Worked example: reading a small payload

A compact payload arrives as a single line, the way payloads usually do:

{"name":"Ovatly","tools":250,"free":true}

Validate only reports it as valid. Formatting it with a 2 space indent turns it into this:

{
  "name": "Ovatly",
  "tools": 250,
  "free": true
}

Now the facts are visible at a glance: name is a string, tools is a number, and free is a boolean. If your handler expected tools to arrive as a string, this is where you find out, by reading the payload instead of guessing at your code. And if the same payload had arrived with a trailing comma after true, validation would have failed and named the problem, and no amount of handler debugging would ever have fixed it.

Limitations and honest tradeoffs

Validation proves syntax, nothing more. A payload can be perfectly valid JSON and still carry values your handler did not expect: a number sent as a string, a renamed field, an extra level of nesting. The check tells you the JSON parses; reading the formatted output tells you whether it matches your assumptions. You need both halves.

Two smaller points. Formatting parses numbers the way JavaScript does, so integers beyond 2^53 can lose exactness when the text is written out again; when you only need a verdict, Validate only leaves the text untouched and avoids that entirely. And very large payloads, in the tens of megabytes, may take a moment to process, because the work happens locally in your browser.

Common mistakes

  • Debugging the handler first. Hours go into working code while the payload sits there broken. Check the payload; it takes a minute.
  • Cleaning up the payload before checking it. If you tidy the text first, you have tested your edited copy, not what actually arrived.
  • Treating valid as correct. Valid JSON can still hold the wrong types and the wrong field names. Read the formatted values.
  • Pasting payloads into upload-based checkers. Customer data leaves your device for the sake of a check that can run locally.
  • Skimming the error message. The error names the problem in plain words. Read it before you start guessing.

FAQs

Why should I check the payload before debugging my handler? Because a handler bug and a broken payload look identical from the outside: nothing happens. Validating the payload first tells you whether the JSON itself parses. If it does not, the error message names the problem and your handler code is not the suspect.

What does the validator actually check? It checks the text against the strict JSON standard and reports the first problem it finds in plain words, such as an unexpected character or a missing comma. Trailing commas, single-quoted strings, unquoted keys and comments all fail, because none of them are valid JSON.

Is it safe to paste a payload that contains customer data? With this tool, yes. The formatter and validator run entirely in your browser and nothing is uploaded, so the payload never leaves your device. That matters for webhook payloads, which routinely carry names, email addresses and order details.

The payload validates. Why does my handler still fail? Validation only proves the JSON is well formed. It says nothing about the values inside. A field your code expects as a number can arrive as a string, or a name can differ from what the sender documented. Format the payload and read the actual values before you change your handler.

What if the payload is very large? Very large pastes, in the tens of megabytes, may take a moment to process. That is the browser doing the work locally. Give it a few seconds rather than pasting repeatedly.

Conclusion

When a webhook misbehaves, check the payload before the code. One paste into the JSON Formatter and Validator tells you whether the JSON parses, what the error is if it does not, and what the values actually are if it does, all without the payload leaving your device. When the next step is sharing that payload with a teammate or a reviewer, our guide to formatting JSON for a code review or bug report covers how to present it so the important field stands out. For more guides in this series, see our Data and JSON Tools guides.

References