GitHub Webhook Signature Verifier

Check an X-Hub-Signature-256 header against the payload and the webhook secret.

The secret entered in the repository’s webhook settings on GitHub.

The exact body GitHub sent. Copying from a log can change line endings or spaces — then the signature cannot match. Use the file field for exact bytes.

More options

Used instead of the pasted text when given.

When you run the tool, this file is uploaded to our server, processed and then deleted. The files the tool creates stay on our server for about 2 hours: download them to keep them, or save them to your Google Drive.

Leave empty to only compute the signature for this payload and secret.

Try an example: · ·

More about this tool

Part of Trackwell

How it works

Computes the HMAC-SHA256 signature GitHub sends with every webhook delivery and compares it with the X-Hub-Signature-256 header you received, in constant time. Use it to debug a webhook receiver that rejects deliveries, or to create a valid signature for a test request. Same check as the Trackwell GitHub sync endpoint.

  • GitHub signs the raw request body (exact bytes, UTF-8) with HMAC-SHA256 (RFC 2104) using the webhook secret as the key and sends “sha256=” plus 64 lower-case hex digits in the X-Hub-Signature-256 header.
  • The tool computes the same HMAC over the payload bytes (the uploaded file as is, or the pasted text encoded as UTF-8) and compares it with the header in constant time, so the comparison itself leaks no timing information.
  • Results: valid (identical), mismatch (wrong secret or changed body), malformed (not “sha256=” + 64 hex digits; the older SHA-1 header X-Hub-Signature is not accepted) or missing (no header given: only the expected signature is shown).
  • When the payload is JSON, the event hints (action, repository, issue number, sender) are read from it for orientation; they are not part of the check.
  • Trackwell’s GitHub sync uses this function for its webhook endpoint and additionally drops deliveries whose X-GitHub-Delivery id was already seen in the last 24 hours.

The secret is used only to compute this result and is not stored. Do not paste secrets of production systems into tools you do not trust; rotate a secret after debugging if in doubt.

Sources

Part of Trackwell

How to verify a GitHub webhook signature (X-Hub-Signature-256)

Check that a GitHub webhook delivery was signed with your secret, or compute the X-Hub-Signature-256 header for a test request, with HMAC-SHA256 over the exact payload bytes.

What it is for

When you add a webhook to a GitHub repository you enter a secret. GitHub then signs every delivery: it computes an HMAC-SHA256 of the raw request body with that secret and sends the result in the X-Hub-Signature-256 header. Your receiver must compute the same value and refuse the request when it differs — otherwise anyone who knows the address could send fake events.

When a receiver keeps answering 401, it is hard to tell whether the secret is wrong, the header is read from the wrong place or the body was changed before checking. This tool takes the secret, the payload and the header and tells you which case you have. Leave the header empty and it only computes the signature, which is handy for sending a test request with curl. Trackwell's GitHub sync endpoint uses the same function to check deliveries.

Worked example

GitHub's documentation publishes test values. With the secret It's a Secret to Everybody and the payload Hello, World! the tool shows:

  • Result: valid — "The signature is valid: the payload was signed with this secret."
  • Expected header: sha256=757107ea0eb2509fc211221cce984b8a37570b6d7586c22c46f4379c8b043e17
  • Payload size: 13 bytes

Now a real-looking delivery: an issues event for issue #12 in octo-org/website, 152 bytes of JSON, secret trackwell-demo-secret, and a header copied from somewhere else (sha256=0e0b4e…dd4f). The result is "The signature is not valid (it does not match)". The tool shows the expected header sha256=e9d81cbfdbc99a63f18a713dd007d007f87ca42058beb3ebb5bb4bd50646d5b4 and reads the delivery details from the JSON: action opened, repository octo-org/website, issue #12, sender octocat. Clear the header field and you get exactly that expected value, ready to paste into a test request.

How to read the result

  • valid — the header matches the HMAC of these bytes with this secret.
  • mismatch — the header is well formed but different. Either the secret is not the one saved on GitHub, or the body you checked is not byte-for-byte what GitHub sent.
  • malformed — the header is not sha256= followed by 64 hex digits. A value starting with sha1= is the older X-Hub-Signature header; use the SHA-256 one.
  • computed only — no header was given, so the tool shows the signature you should expect.

The SHA-256 of the payload helps you compare two copies of a body: if the hashes differ, the bytes differ, and no secret will make both match. The delivery details table is only for orientation and plays no part in the check.

Tips and common mistakes

  • Verify the raw body. Frameworks that parse JSON first and serialise it again change spaces and key order, and the signature no longer matches.
  • Pasting from logs or terminals can turn line endings into CRLF or drop a trailing newline. The tool warns about CRLF; for exact bytes, save the body to a file and upload it.
  • Compare signatures in constant time (Node's crypto.timingSafeEqual, Python's hmac.compare_digest), never with ==.
  • Secrets are case-sensitive and may contain spaces. A secret pasted with a trailing space is a different secret.
  • After debugging with a production secret, create a new one on GitHub.

FAQ

Does the tool store my secret?

No. The secret is used only to compute this one result. Like any tool page, though, treat production secrets carefully and rotate them if you are unsure.

Why does GitHub not sign a timestamp?

GitHub's signature covers only the body. To stop a recorded delivery from being replayed, remember the X-GitHub-Delivery id for a while and ignore repeats — Trackwell keeps them for 24 hours — and treat the payload as a trigger to re-read the current state from the API.

Can I check deliveries of GitHub Apps or organisation webhooks?

Yes. Repository, organisation and GitHub App webhooks all use the same X-Hub-Signature-256 scheme with the webhook secret.

Guide last updated:

For scripts and AI agents

  • JSON API: POST https://trackwellgithubwebhookverify.usefulweb.app/api/v1/calculate (same calculation as this page)
  • Interface description: OpenAPI 3.1 · AI guide: llms.txt
  • MCP server (Streamable HTTP): https://trackwellgithubwebhookverify.usefulweb.app/mcp · tool name trackwell_github_webhook_verify
Example request
curl -s -X POST https://trackwellgithubwebhookverify.usefulweb.app/api/v1/calculate \
  -H 'content-type: application/json' \
  -d '{"secret":"It's a Secret to Everybody","payload":"Hello, World!","signature":"sha256=757107ea0eb2509fc211221cce984b8a37570b6d7586c22c46f4379c8b043e17"}'
Feedback · ideas & bug reports welcome