← Back to Home

HMAC Calculator

/hmac
Calculate HMAC (Hash-based Message Authentication Code) signatures for API authentication and data verification. Supports SHA-256, SHA-384, and SHA-512.
Try it now

Parameters

data body
Data to sign (required)
key body
Secret key (required)
algorithm body
Hash algorithm: sha256, sha384, sha512 (default: sha256)

Examples

curl
# HMAC-SHA256 signature
curl -X POST https://tcpdata.com/hmac \
  -H "Content-Type": "application/json" \
  -d '{"data":"message","key":"secret","algorithm":"sha256"}'

# Verify webhook signature
curl -X POST https://tcpdata.com/hmac \
  -H "Content-Type: application/json" \
  -d '{"data":"webhook-payload","key":"webhook-secret"}'
JavaScript (fetch)
const response = await fetch('https://tcpdata.com/hmac', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    data: 'API request body',
    key: 'api-secret-key',
    algorithm: 'sha256'
  })
});
const result = await response.json();
console.log(result.hmac);
Python (requests)
import requests

response = requests.post('https://tcpdata.com/hmac', json={
    'data': 'API request body',
    'key': 'api-secret-key',
    'algorithm': 'sha256'
})
print(response.json()['hmac'])