A browser-based HMAC generator can create full HMAC-SHA-256, HMAC-SHA-384, or HMAC-SHA-512 tags on Android using exact UTF-8 or hexadecimal input bytes.

On an Android phone or tablet, open the HMAC Generator in a browser that supports the Web Cryptography API. The calculation runs in the current tab through native Web Crypto; the key and message are not sent to the site's server. This is a browser workflow rather than a native APK or an Android SDK, so it is suited to manual tag generation and protocol checks.

hmac generator on android
HMAC Generator on Android: Browser Steps for Exact Tags

What the mobile generator produces

HMAC combines a cryptographic hash with a shared secret key. A verifier holding the same key and the exact message bytes can calculate the same tag, which detects modification and authenticates the party that knew the key. It does not conceal the message, and someone who learns the key can forge valid tags. The formal construction is defined in NIST FIPS 198-1.

Hash Full tag length Available renderings
SHA-256 32 bytes Lowercase hex and standard padded Base64
SHA-384 48 bytes Lowercase hex and standard padded Base64
SHA-512 64 bytes Lowercase hex and standard padded Base64

The page always displays the complete tag in lowercase hexadecimal and standard padded Base64. These are two renderings of the same tag bytes, not two different calculations.

Generate an HMAC on Android

  1. Open the generator and identify the protocol rules. Load the HMAC Generator page in your Android browser. Before entering a secret, confirm the required hash, the key's representation, the exact message bytes, and whether the destination accepts a full tag.
  2. Choose the specified hash. Select SHA-256, SHA-384, or SHA-512 to match the protocol rather than choosing by appearance. If the protocol later truncates the result, calculate the specified full tag first and apply that truncation rule afterward.
  3. Set the key and message encodings independently. Choose UTF-8 or hexadecimal for each field. The two selections do not have to match: for example, a protocol may define a binary key alongside UTF-8 message text.
  4. Enter the exact values. Do not add quotes, labels, separators, or a trailing newline unless those bytes are part of the protocol value. In hexadecimal mode, use only an even number of hexadecimal digits; prefixes, spaces, colons, and odd nibbles are rejected.
  5. Generate the tag and wait for the current result. Empty keys and messages are rejected by this interface, and each decoded field is limited to 1,000,000 bytes. If an input changes while Web Crypto is working, an identity token prevents an older result from overwriting the newer state.
  6. Copy the tag in the required format. Copy the full lowercase hexadecimal or standard padded Base64 result. Apply truncation, an algorithm prefix, Base64url conversion, or another envelope only when the protocol explicitly requires it. Do not trim the tag by eye, and close the tab when the secret is no longer needed.

Choose UTF-8 or hexadecimal for each field

HMAC operates on bytes, so two visibly similar inputs can produce different tags. Choose the mode that reproduces the protocol's source bytes without conversion guesswork.

Input mode What it represents Strict behavior Best fit
UTF-8 Text characters Each field is encoded as UTF-8 when that field uses text mode. Protocols that explicitly define UTF-8 text
Hexadecimal An exact binary byte sequence Requires an even number of hex digits, preserves zero bytes, and rejects prefixes, spaces, colons, and odd nibbles. Published vectors and binary protocol fields

Text mode encodes each selected field as UTF-8. Accented letters, CJK characters, and emoji occupy multiple bytes, while spaces, tabs, and line endings also contribute bytes. A message copied without its final newline is a different HMAC input.

Hex mode is exact and strict, so it is preferable for published test vectors and binary fields. For example, the byte sequence containing a zero value must retain its complete hexadecimal representation rather than losing or adding a digit.

Browser tool or native Android app?

Use the browser workflow for a manual tag during API integration, a one-off calculation, or a comparison against a server-generated result. The tool requires compatible browser cryptography and manual entry into its key and message fields; it does not read an Android Keystore alias or become part of an application's signing code.

If an Android app must sign every request automatically, use an Android cryptographic API inside that app instead of automating taps in a web form. Native code can also apply the protocol's canonicalization, key lifecycle, and response verification in the same workflow.

For the web page, keep the tab open only as long as needed. Key material stays in the current tab, and the site's server does not receive the entered key or message. If the device is shared or untrusted, do not paste a production secret into it.

Apply only the output rules your protocol requires

Start with the full tag. The generator does not shorten it, prefix it with an algorithm name, switch to Base64url, create a canonical request string, or package the message with its tag.

  • If the protocol requires a truncated tag, apply its specified truncation length after generating the full tag.
  • If it requires an algorithm identifier, prepend the exact identifier and formatting defined by the specification.
  • If it signs a canonical request string, construct that string separately and enter its exact resulting bytes as the message.
  • If it expects a binary envelope, assemble that envelope according to the protocol instead of treating the displayed Base64 as the complete payload.
  • If it expects Base64url, convert the standard tag using the required Base64url rules rather than substituting characters by eye.

Hexadecimal and Base64 represent identical tag bytes. Standard Base64 and Base64url are not interchangeable, however, because their character sets, padding rules, and accepted forms can differ.

Protect the key and compare the result safely

HMAC is only as trustworthy as the key and the endpoint that verifies it.

  • Use independently generated, high-entropy key material appropriate for the protocol.
  • Distribute and store the key through a protected channel, and separate keys by purpose.
  • Rotate a key after a compromise and avoid reusing it for unrelated services.
  • When a human password must become a key, use the exact password-based derivation scheme and parameters required by the application; a password is not automatically a strong HMAC key.
  • Compare the complete tags in the required encoding with a constant-time function on the server.
  • Avoid pasting production secrets into an untrusted device, and remember that matching tags establish shared-key and byte consistency, not message confidentiality.

Resolve a mismatched tag

When an Android utility, server, or second generator returns a different value, compare the input contract before changing any tag.

  1. Confirm the hash. SHA-256, SHA-384, and SHA-512 produce different tag lengths and values.
  2. Verify the key byte for byte. Check its encoding, leading or trailing zero bytes, and whether the other system derived the key differently.
  3. Verify the message byte for byte. Look for spaces, tabs, a final newline, quotation marks, or a different UTF-8 interpretation.
  4. Check truncation rules. One implementation may display the full HMAC while another transmits only a protocol-defined prefix.
  5. Check the output spelling. Confirm whether the protocol expects hexadecimal, standard Base64, Base64url, or an identifier-prefixed value.

The generator's correctness checks are locked to eight full RFC 4231 conformance tags. They cover short keys, binary repeated-byte keys and data, keys smaller than the digest, and data crossing hash block boundaries for SHA-256 and SHA-512. SHA-384 is exposed as the Web Crypto-defined option. Use the RFC 4231 test vectors as a known-answer reference when diagnosing setup mistakes.

For a deeper look, see Morse Code Translator on Android: Browser Workflow.

For a deeper look, see HMAC Generator on iPhone: Create Tags Locally.