JSON pretty-print changes signed payload bytes
Bad input: Receiver recomputes HMAC on reformatted JSON body.
Failure: Valid requests are rejected due to signature mismatch.
Fix: Sign and verify exact raw bytes, not reconstructed objects.
Generate HMAC-SHA1, SHA256, SHA512 online
Quick CTA
Paste the message and secret first, then generate the HMAC; algorithm comparisons and edge cases stay in Deep.
Next step workflow
Deep expands pitfalls, recipes, snippets, FAQ, and related tools when you need troubleshooting or deeper follow-through.
Generate HMAC (Hash-based Message Authentication Code) values instantly in your browser. Supports HMAC-SHA1, HMAC-SHA256, and HMAC-SHA512 algorithms. Enter your message and secret key to compute secure authentication hashes using the Web Crypto API. No data is transmitted β everything runs 100% client-side.
Hash
Use it for non-secret checksums and general fingerprinting.
HMAC
Use it for signed payload verification where a shared secret is required.
Note: If trust depends on a secret, plain hashing is not enough.
HMAC
Use it for server-to-server integrations where both sides can securely store one shared secret.
RSA/ECDSA signatures
Use it when key distribution, third-party verification, or non-repudiation requirements are stronger.
Note: HMAC is simple and fast; asymmetric signatures scale better across multiple verifiers.
Fast pass
Use for low-impact exploration and quick local checks.
Controlled workflow
Use for production delivery, audit trails, or cross-team handoff.
Note: Hmac Generator is more reliable when acceptance criteria are explicit before release.
Direct execution
Use for disposable experiments and temporary diagnostics.
Stage + verify
Use when outputs will be reused by downstream systems.
Note: Staged validation reduces silent compatibility regressions.
Bad input: Receiver recomputes HMAC on reformatted JSON body.
Failure: Valid requests are rejected due to signature mismatch.
Fix: Sign and verify exact raw bytes, not reconstructed objects.
Bad input: Edge payloads omit required fields.
Failure: Output appears valid locally but fails during downstream consumption.
Fix: Normalize contracts and enforce preflight checks before export.
Bad input: One-step execution bypasses review checkpoints.
Failure: Same source data yields inconsistent outcomes across environments.
Fix: Declare compatibility constraints and verify with an independent consumer.
Q01
HMAC combines the payload with a shared secret, so it proves both integrity and secret possession rather than just content fingerprinting.
Q02
Whitespace, line endings, timestamps, ordering, and encoding differences can all change the signed byte stream.
Recommend: Use raw-byte canonicalization and strict algorithm agreement.
Avoid: Avoid verifying on parsed-and-reserialized payloads.
Recommend: Use fast pass with lightweight verification.
Avoid: Avoid promoting exploratory output directly to production artifacts.
Recommend: Use staged workflow with explicit validation records.
Avoid: Avoid one-step execution without replayable evidence.
Cause: A pretty-printed JSON body is not the same byte stream the sender may have signed.
Fix: Sign the exact raw bytes or canonical form defined by the integration contract.
Cause: Many webhook systems sign `timestamp.payload` rather than the payload alone.
Fix: Replicate the exact signing template before concluding the secret is wrong.
Cause: Whitespace changes alter bytes, so signatures no longer match provider-generated values.
Fix: Always sign the raw payload bytes exactly as received before any parsing or formatting.
Goal: Generate the exact HMAC for the payload you captured before changing webhook or gateway code.
Result: You can isolate whether the mismatch comes from payload drift, secret drift, or canonicalization drift.
Goal: Reproduce a failing webhook signature by hashing the exact timestamp + raw payload format.
Result: You can pinpoint whether failures come from payload canonicalization, key mismatch, or clock skew.
Goal: Align sender and receiver signing behavior across environments.
Result: Webhook authentication failures are reduced in production.
Goal: Validate assumptions before output enters shared workflows.
Result: Delivery quality improves with less rollback and rework.
Goal: Convert recurring failures into repeatable diagnostics.
Result: Recovery time drops and operational variance shrinks.
text
1700000000.{"event":"user.created","id":"evt_123"}HMAC Generator works best when you apply it with clear input assumptions and a repeatable workflow.
Use this tool as part of a repeatable debugging workflow instead of one-off trial and error.
Capture one reproducible input and expected output so teammates can verify behavior quickly.
Keep tool output in PR comments or issue templates to shorten communication loops.
When behavior changes after deployment, compare old and new outputs with the same fixture data.
HMAC Generator is most reliable with real inputs and scenario-driven decisions, especially around "Need stable HMAC verification for external callbacks".
HMAC (Hash-based Message Authentication Code) is a mechanism for verifying both data integrity and authenticity using a secret key combined with a cryptographic hash function.
They differ in hash length and security strength. SHA-256 and SHA-512 are more secure and recommended for modern applications, while SHA-1 is considered deprecated for high-security use cases.
Yes. All HMAC calculations are performed locally in your browser using the Web Crypto API. Your message and secret key are never transmitted to any server.
Yes, but you should still validate output in your real runtime environment before deployment. HMAC Generator is designed for fast local verification and clean copy-ready results.
Yes. All processing happens in your browser and no input is uploaded to a server.
Use well-formed input, avoid mixed encodings, and paste minimal reproducible samples first. Then scale to full content after the preview looks correct.