How to Identify a Hash Algorithm from a Hash String
Length and character set narrow an unknown hash down fast. How to tell MD5 from SHA-256, and how to spot bcrypt, Argon2 and NTLM from their prefixes.
ProfitTool Team
Security & Dev
Why Hash Identification Matters
Developers frequently encounter hash strings without clear context — a password field in a legacy database, a file checksum in documentation, an API token format. Identifying the algorithm helps you understand the security properties (is it crackable? is it a password hash or a data hash?) and make appropriate decisions.
Identification by Length (Hex Hashes)
For hashes stored as hexadecimal strings, length alone narrows the candidates significantly:
| Hex length | Bits | Possible algorithms |
|---|---|---|
| 8 chars | 32 | CRC32 |
| 16 chars | 64 | MySQL 3.x |
| 32 chars | 128 | MD5, NTLM, RIPEMD-128 |
| 40 chars | 160 | SHA-1, RIPEMD-160 |
| 56 chars | 224 | SHA-224, SHA3-224 |
| 64 chars | 256 | SHA-256, SHA3-256, BLAKE2s |
| 96 chars | 384 | SHA-384, SHA3-384 |
| 128 chars | 512 | SHA-512, SHA3-512, Whirlpool |
Identification by Prefix (Password Hashes)
Password hashing algorithms add recognisable prefixes that identify both the algorithm and parameters:
| Prefix | Algorithm |
|---|---|
$1$ | MD5 crypt (legacy Linux) |
$2b$ or $2a$ | bcrypt |
$5$ | SHA-256 crypt (Linux) |
$6$ | SHA-512 crypt (Linux) — most common |
$argon2i$ | Argon2i |
$argon2d$ | Argon2d |
$argon2id$ | Argon2id (recommended) |
pbkdf2_sha256$ | Django PBKDF2 |
{SSHA} | Salted SHA-1 (LDAP) |
What You Cannot Determine From Length Alone
Several algorithms produce hashes of the same length. A 32-character hex string could be MD5, NTLM, or RIPEMD-128. A 64-character hex string could be SHA-256, SHA3-256, or SHA-512/256. Context matters — where did the hash come from?
Data Hash vs Password Hash
- Data hashes (checksums, file integrity): typically SHA-256, SHA-512, BLAKE3. Fast algorithms are appropriate here.
- Password hashes: must use slow, salted algorithms (bcrypt, Argon2, PBKDF2). If you find an MD5 or SHA-1 password hash, it is insecure.
Use our Hash Type Identifier to paste any hash and get instant identification results.
ProfitTool Team
Security & DevWritten and maintained by the ProfitTool team. Where an article references a ProfitTool utility, the behaviour described is the behaviour of the tool on this site — you can open it and check the output yourself.
More from the Knowledge Hub
What Is a Hash Function? Cryptographic Hashing Explained
A cryptographic hash function transforms any input into a fixed-length output. This guide explains what makes a hash function secure, what it is used for, and the difference between hashing and encryption.
Privacy & SecurityPassword Hashing Algorithms: bcrypt, Argon2 and PBKDF2 Compared
Passwords should never be stored in plain text or with fast hash functions like MD5 or SHA-256. This guide explains why slow, purpose-built password hashing algorithms are essential and how to choose one.
Developer ToolsSHA-256 vs SHA-512: Which Hash Algorithm Should You Use?
Both are SHA-2 and both are secure — the difference is digest size and word width. Why SHA-512 is often faster on 64-bit CPUs, and which to pick.