An HMAC generator on iPhone can run in the browser and produce a full HMAC-SHA-256, HMAC-SHA-384 or HMAC-SHA-512 tag without sending the key or message to the site server.

Use the HMAC Generator when a phone-based workflow needs the exact tag required by an API, webhook or other protocol. The page uses the browser's Web Cryptography API, processes the inputs in the current tab, and does not send them to the site's server.

The browser workflow succeeds when you identify the protocol's hash, encode the key and message as the intended bytes, and copy the tag in the required output format.

hmac generator on iphone
HMAC Generator on iPhone: Create Tags Locally

Generate an HMAC on iPhone

Follow this order so the result can be compared directly with the receiving system:

  1. Open the generator in your iPhone browser. Load the HMAC Generator page and wait for the form to load. The calculation runs through the browser's Web Cryptography API rather than on the site's server.
  2. Select the required hash. Choose SHA-256, SHA-384 or SHA-512 exactly as named by the protocol. Confirm that the protocol expects a full HMAC tag; if it defines a shorter value, apply its explicit truncation rule afterward rather than guessing.
  3. Set the key and message modes independently. The page allows a UTF-8 key with a hexadecimal message, or a hexadecimal key with a UTF-8 message, because the two fields can contain different kinds of bytes.
  4. Enter the exact key. In UTF-8 mode, enter the required characters exactly; accented letters, CJK characters and emoji occupy multiple bytes. In hexadecimal mode, paste only the byte sequence as an even number of hexadecimal digits. Prefixes, spaces, colons and odd nibbles are rejected, so remove labels and separators instead of guessing which characters the protocol intended.
  5. Enter the exact message. In UTF-8 mode, preserve capitalization, spaces, line breaks and any trailing newline. A trailing newline is still a byte. In hexadecimal mode, apply the same strict formatting rules used for the key.
  6. Generate the tag. Run the generator after the hash and both input fields are final.
  7. Copy the required output. The complete result is available in lowercase hexadecimal and standard padded Base64. These are two renderings of identical tag bytes. If an input changes while Web Crypto is working, an identity token prevents an older result from overwriting the newer state; still confirm that the displayed tag reflects the current field values.
  8. Use the exact representation required by the verifier. Paste only the specified form, and compare the complete tag. A server-side verifier should use a constant-time comparison function.

Two input limits matter on iPhone: empty keys and messages are rejected by this interface, even though some low-level standards define behavior for zero-length data, and each decoded field is capped at 1,000,000 bytes. A legitimate protocol value beyond that limit requires a different calculation workflow.

Pick UTF-8 or Hex for Each Field

The key and message are separate byte sequences, so select their input modes independently. UTF-8 and hexadecimal are different representations of bytes, not interchangeable labels.

Input modeWhat to enterBest fitImportant detail
UTF-8Characters encoded as UTF-8 bytesA protocol that explicitly specifies UTF-8 textAccents, CJK characters and emoji use multiple bytes; whitespace remains part of the input.
HexPaired hexadecimal digits representing exact bytesPublished test vectors, binary keys and binary messagesThere must be an even number of digits, with no prefixes, spaces, colons or odd nibbles; zero bytes are preserved.

Prefer hexadecimal mode for published vectors and binary fields because it exposes the bytes directly. If the protocol supplies human-readable text, select UTF-8 and enter it without adding a label, quotation mark or extra line break. Entering a hexadecimal string in UTF-8 mode treats its letters as text rather than decoding them as bytes, while entering text in hexadecimal mode requires converting that text first.

Match the Hash and Output to the Protocol

The hash choice determines the full tag size; it is not a preference based on how long the displayed result looks.

AlgorithmFull tag sizeLowercase hex length
SHA-25632 bytes64 characters
SHA-38448 bytes96 characters
SHA-51264 bytes128 characters

The generator always provides the full tag for the selected algorithm. It does not offer SHA-1, so a protocol that specifically requires SHA-1 cannot be satisfied by this tool.

The page also does not emit Base64url, prepend an algorithm identifier, package the message with its tag, or shorten the result. Some protocols require one of those transformations. Apply a conversion, prefix, envelope or truncation only when the governing specification explicitly requires it, and never trim a tag by eye.

Hexadecimal and standard padded Base64 represent the same tag bytes, but the receiver may require one exact string. A Base64url field is not interchangeable with a standard Base64 field, even though the two forms can look similar.

If the protocol signs a canonical request string, construct that string according to its rules before entering it as the message. The generator authenticates exactly the bytes placed in the message field; it does not assemble timestamps, paths, headers or request envelopes for you. Internally, the selected bytes are imported as a non-exportable Web Crypto HMAC key, and the signing operation returns the complete tag.

Why an iPhone HMAC May Differ

A matching algorithm and secret are not enough if either byte sequence differs. Check these points before changing the key:

  • Algorithm: SHA-256, SHA-384 and SHA-512 produce different tags for the same key and message.
  • Key representation: A UTF-8 human password and the UTF-8 bytes of a generated secret are not the same key.
  • Message representation: An added space, changed line ending, trailing newline or different Unicode characters changes the signed bytes.
  • Hex formatting: Malformed hex is normally rejected, but a valid hexadecimal sequence can still represent different bytes from the intended value.
  • Output and length: Confirm whether the verifier expects hexadecimal, standard Base64 or Base64url, and whether it compares the full tag or a specifically defined truncation.

Copying on an iPhone is convenient, but avoid retyping a production key or message when byte identity matters. The byte-exact HMAC troubleshooting checklist provides a structured way to review these choices.

To separate an input-handling mistake from an implementation problem, test with a published RFC 4231 test vector. The generator's conformance set covers eight full RFC 4231 tags for SHA-256 and SHA-512, including short keys, repeated-byte binary keys and data, keys smaller than the digest, and messages crossing hash block boundaries. SHA-384 remains available as the Web Crypto-defined choice exposed by the interface.

Protect the Key and Interpret the Tag

HMAC authenticates exact message bytes with a shared secret; it does not conceal the message. Anyone who sees plaintext can still read it, and anyone who learns the key can forge valid tags. The construction is defined in NIST FIPS 198-1.

Manage the secret according to the protocol and the sensitivity of the data:

  • Use independently generated, high-entropy key material appropriate for the protocol.
  • Distribute production keys through a protected channel and separate keys by purpose.
  • Rotate a key after a compromise and avoid reusing it for unrelated systems.
  • Do not assume a human password is a strong HMAC key. If the application requires password-derived key material, use its specified key-derivation function and parameters first. This generator uses the selected bytes as the key and does not perform password derivation.

Browser-side processing prevents the key and message from being sent to the site server, but it does not make an untrusted iPhone safe for production secrets. Compare the full tag in the required encoding with a constant-time function on the server. A successful match demonstrates shared-key and byte consistency, not message confidentiality.

Related reading: Morse Code Translator on iPhone: Text, Audio & Copy.