SM3 Hash Calculator

Calculate SM3 hashes or HMAC-SM3 values for text, files, or URLs locally in your browser. SM3 is the Chinese GM/T 0004 cryptographic hash algorithm. Read more

What is SM3?

SM3 is a 256-bit cryptographic hash function used in China’s commercial cryptography standards, including GM/T 0004. It maps input bytes to a digest normally shown as 64 hexadecimal characters. The same input bytes always produce the same SM3 value.

This calculator runs entirely in your browser and supports text, local files, and URLs. It can also compute HMAC-SM3 when a key is provided.

How to calculate an SM3 hash

  1. Choose Text, File, or URL as the input type.
  2. Enter text, select a local file, or provide a URL.
  3. For text input, choose the input encoding that matches those bytes.
  4. Optionally enable HMAC and enter the key.
  5. Choose Hex or Base64 output, then click Hash.

File and URL modes hash the raw input bytes. Text mode respects the selected input encoding.

HMAC-SM3

Enable HMAC to compute a keyed message authentication code with SM3 as the underlying hash. Enter the exact key bytes using UTF-8, Hex, Base64, or another encoding. Matching HMAC values requires the same key bytes and the same message bytes.

A plain SM3 digest is unkeyed and does not prove who supplied the message. Use HMAC-SM3 only when both sides share a secret key through an appropriate protocol. Do not use fast hashes such as SM3 directly for password storage.

Result example

UTF-8 abc produces:

66c7f0f462eeedd9d1f2d46bdc10e4e24167c4875cf2f7a2297da02b8f4ba8e0

With HMAC key UTF-8 key and message UTF-8 abc, the result is:

28e63256e7c5a087b1f073265dc53092163f7b82729735d06f28f10af9d52393

Is SM3 the same as SHA-256?

No. SM3 and SHA-256 both produce 256-bit digests, but they are different algorithms and return different values for the same input. Use SM3 when a specification requires GM/T 0004 or Chinese commercial cryptography (国密); use SHA-256 when the protocol calls for SHA-2.

Input
Advertisement
Output
Share Link
Settings
Advertisement