AI Tools Free

HMAC Generator

Calculate HMAC-SHA-256, SHA-384, or SHA-512 locally and copy hexadecimal or Base64 output.

Free to useNo sign-upRuns in your browser
Enter your details

Enter the inputs, then select Generate HMAC.

Your result
Enter your details

Result will appear here

How HMAC Generator works

Browser Web Crypto computes an HMAC from the UTF-8 message and key with the selected SHA algorithm, then represents the bytes as hexadecimal or Base64.

A nonempty key is required, while an empty message is allowed. This produces an authentication code; it does not encrypt the message or verify a remote request.

Web Crypto needs a secure context such as HTTPS or trusted localhost.

Reference: MDN: HMAC signing.

A text message and key connected to an HMAC output.
Illustration of the HMAC Generator workflow.

HMAC Generator Quick Reference & Input Guide

Review the input parameters, allowed value ranges, and worked reference cases for the HMAC Generator below before running your calculation.

Parameter / ScenarioDefault / Sample ValueRule or Allowed RangeOutput / Usage Note
Input: Secret key (UTF-8)(User supplied)Input type: passwordRequired workspace parameter
Input: Message(User supplied)Input type: textareaRequired workspace parameter
Input: Hash algorithm(User supplied)Options: SHA-256, SHA-384, SHA-512Required workspace parameter
Input: Output encoding(User supplied)Options: Hexadecimal, Base64Required workspace parameter

How to use HMAC Generator

Use the exact message and a UTF-8 text key, then choose the required hash and output encoding.

Match the signing inputs

Enter the literal UTF-8 key and exact message, preserving meaningful spaces and line breaks. Select SHA-256, SHA-384, or SHA-512 and the hexadecimal or Base64 output expected by the consumer.

Secret key (UTF-8)
HMAC Generator native input panel with the actual Secret key (UTF-8), Message, Hash algorithm settings used for this example.
Configure Secret key (UTF-8), Message, Hash algorithm; select Generate HMAC.

Compute the authentication code

Run the generator and inspect the HMAC output. The result identifies the selected algorithm, byte length, and output encoding; these must match the comparison you intend to make.

HMAC ready
HMAC Generator actual result panel showing HMAC ready.
Submitted result: HMAC ready. Bytes: 64.

Copy the selected encoding

Copy the generated code and keep its algorithm and encoding with it. Review the UTF-8 processing note when a comparison differs. A key that looks like hex is still text, and no remote verification occurs.

Output and export
HMAC Generator actual output and export region and result note after submitting the pictured settings.
Review the actual HMAC Generator output and visible Copy result controls. Read the result note.

When to use HMAC Generator

Compare baseline and alternative runs for HMAC Generator before exporting the result.

Generate an HMAC for a webhook example

Reproduce the message text from an integration example and generate its HMAC using the stated algorithm. If the code differs, compare the exact key representation and message first. A visually similar request body can contain a different newline or different spacing.

Developer input and configuration represented by document cards.
Prepare the input. Concept illustration.

Compare hexadecimal and Base64 HMAC output

Generate hexadecimal and Base64 versions for the same message and algorithm when documenting an interface. They are representations of the authentication code, not separate encryption choices. Keep the encoding label with the copied value so another person can compare like with like.

A developer example flowing from input to reviewed output.
Inspect an example. Concept illustration.

Investigate a signing mismatch

Use a small known message to isolate the key, algorithm, and encoding before working with a longer payload. A matching small example narrows the investigation, but it does not prove that the full request signing process handles headers or canonicalization correctly.

Developer output handed to the next stage of a workflow.
Use the result in your workflow. Concept illustration.

Separate authentication from encryption

Review the calculated output alongside your entered parameters and unit conventions.

Every calculation follows the rule: HMAC = keyed message authentication using the selected SHA hash. Both message and key are UTF-8 encoded. Because JavaScript uses IEEE 754 double-precision floating-point arithmetic, numeric outputs display up to 12 significant digits where applicable.

Always cross-check the displayed result against the scope note (Requires HTTPS or a trusted localhost context for Web Crypto. The key is not stored or sent to a server; this is an authentication code, not encryption) before applying the value to production specifications, financial models, or lab records.

A developer result reviewed alongside its source.
Review the returned output. Concept illustration.

Check the environment and key format

Confirm the exact text and selected options before comparing this code with another implementation.

Operational scope: Requires HTTPS or a trusted localhost context for Web Crypto. The key is not stored or sent to a server; this is an authentication code, not encryption. Inputs that violate minimum/maximum bounds or required format rules are rejected with a clear diagnostic prompt.

Need an adjacent calculation in Developer Tools? Use the related tools linked below to chain your workflow without leaving your browser.

Input format and assumptions reviewed for a developer task.
Check format and assumptions. Concept illustration.

Frequently Asked Questions About HMAC Generator

Answers about using HMAC Generator and understanding its results.

Is the key interpreted as hex?

No. The entered key is UTF-8 text, even when it contains hexadecimal-looking characters.

Can I hash an empty message?

Yes, with a nonempty key.

Which hash algorithms can I select?

The form offers SHA-256, SHA-384, and SHA-512 HMAC, with hexadecimal or Base64 output.

Why does a final newline matter?

It changes the message bytes used in the computation. Preserve meaningful whitespace when comparing an expected HMAC.

Calculate an HMAC for your message

Choose another tool for your next calculation, conversion, or text task.

Generate an HMAC