Skip to content
← Back

SM3 Hash Generator Online - Chinese National Standard (GM/T 0004)

Security
Runs locally · Not uploaded

Online SM3 hash calculator: instant 256-bit digests for any text including Chinese and Emoji. SM3 is the Chinese national standard (GM/T 0004-2012), comparable to SHA-256. Runs locally in your browser.

Was this result helpful?

For local tools, open DevTools → Network and search your input — it should not appear in requests.

Usage Guide

SM3 is the hash standard of the Chinese national cryptography family (GM/T 0004), producing a fixed 256-bit digest — think of it as the SHA-256 of the Chinese crypto stack. It is a hard requirement when integrating with government, finance or compliance-grade systems. This tool computes SM3 locally; input never leaves the machine. Digests are for integrity checks, not reversible ciphertext.

1. How to use

  1. Enter any text (CJK and binary-encoded strings both fine).
  2. The 64-hex-char SM3 digest appears immediately.
  3. Copy it for integrity comparison or API integration.

2. When SM3 instead of SHA-256

  • Systems under Chinese cryptographic compliance (classified protection 2.0 / crypto evaluation) name their algorithms explicitly — SHA-256 cannot substitute for SM3.
  • Government, banking and state-owned enterprise interfaces typically specify SM3 for signing digests.
  • Outside compliance contexts, the choice follows whatever the counterparty specifies.

3. A useful comparison

SM3 and SHA-256 are structurally cousins (Merkle–Damgård, 256-bit output, comparable collision resistance) — the choice is driven by compliance, not by a security gap. Try hashing the same input on both this page and the SHA-256 tool: the digests differ completely, which is the practical illustration that hashing only lines up between endpoints running the same algorithm.

4. If you searched "SM3 encryption", read this first

SM3 is a hash (digest) algorithm, not encryption — it has no key and cannot be reversed; the output never recovers the input. If you need encrypt-then-decrypt, symmetric encryption is SM4 and asymmetric is SM2 (both have dedicated tools on this site); SM3 exists to prove data has not changed — matching digests mean identical content. Plenty of searches call hashing "encryption"; clearing up that boundary saves half the detour in algorithm selection.

5. Quick selector for the three SM algorithms

  • Encrypt data (reversible): SM4 symmetric, or SM2 public-key encryption for short payloads.
  • Tamper-proofing / digital signatures: SM3 produces the digest, SM2 signs it.
  • One-way hashing for password storage: SM3 works, but it is fast and general-purpose — salted slow hashes (bcrypt and friends) remain the standard answer for passwords.

6. Two frequent causes of mismatched digests

First, encoding drift: the same Chinese sentence hashes differently as UTF-8 versus GBK — unify the encoding before comparing. Second, invisible characters in the pre-image: interface signing typically hashes a sorted concatenation of parameters, and subtle differences in separators, empty parameters or a trailing newline change the digest entirely. While debugging, diff the exact pre-hash strings on both ends character by character (the text-diff tool on this site works); only suspect the algorithm implementation after the pre-images match but digests still differ.

7. Standard numbers and this tool's boundary

SM3 may appear as GM/T 0004-2012 or GB/T 32905-2016 — industry vs national vintages of the same algorithm, not two hashes. This page computes plain digests only (not HMAC-SM3, not Guomi TLS transcript hashing). For family selection and TLCP vs RFC 8998, see the [Chinese cryptography guide](/en/blog/guomi-algorithms-guide) and [standard-number decoder](/en/blog/sm-standard-numbers-explained).

8. Output shape and acceptance

Output is 64 lowercase hex digits (256-bit). Lock encoding (UTF-8 vs GBK) and strip invisible whitespace before blaming the hash. This page is plain SM3, not HMAC-SM3. The same input on SHA-256 will differ — that is expected.

FAQ

Both output 256-bit digests from similar Merkle–Damgård designs with comparable strength. The difference is lineage: SM3 is the Chinese commercial cryptography standard; SHA-256 is a NIST standard. Chinese compliance scenarios (等保, government, finance) require SM3. GM/T 0004-2012 and GB/T 32905-2016 are the industry and national editions of the same algorithm, not two hashes. See the SM3 vs SHA-256 article on this site for details.

SM3("abc") = 66c7f0f462eeedd9d1f2d46bdc10e4e24167c4875cf2f7a2297da02b8f4ba8e0. This tool reproduces it exactly — a quick way to verify any SM3 implementation.

No. SM3 is a hash (digest) algorithm — keyless, irreversible, and impossible to turn back into the input. When you need encrypt-then-decrypt, reach for SM4 (symmetric) or SM2 (asymmetric); SM3's job is proving data has not changed: identical digests mean identical content. It is also fast and general-purpose, so for password storage choose a salted slow hash like bcrypt.

Two frequent causes. Encoding: the same Chinese text yields different bytes in UTF-8 and GBK, so align encodings first. Invisible characters: separators, empty parameters, and trailing newlines in the sorted parameter join will completely change the digest. Compare the two pre-hash strings character by character (the text-diff tool on this site helps); only if they match while the digests still differ should you suspect the implementation.

This tool computes plain SM3 digests. HMAC-SM3 follows the same construction as HMAC-SHA256 (key padding + double hashing); if you need that scenario, send the request first.

No. SM3 computation happens entirely in your browser with zero network requests.

Related Tools

Related Articles