Hash Identifier
Paste a hash to detect its probable algorithm using pattern matching.
How pattern matching works
Each hash algorithm produces output with specific characteristics: length, character set, and prefix patterns. By analyzing these properties, we can identify the most likely algorithm used.
Introduction
You found a hash in a database dump, a config file, a password breach list — but which algorithm produced it? This tool answers that question instantly. Paste any hash and it detects the likely algorithm by analyzing length, character set, and structural prefixes. From MD5's 32-character hex strings to bcrypt's structured $2a$ prefixes, this identifier covers the algorithms you'll encounter in the real world.
What This Tool Does
A hash identifier detects the probable cryptographic algorithm used to produce a given hash string through pattern matching analysis. It examines the hash's length (MD5=32 hex, SHA-1=40, SHA-256=64, SHA-512=128), character composition, and structural prefixes (bcrypt starts with $2a$, Argon2 with $argon2id$). The tool assigns confidence scores to each match, distinguishing between high-confidence identifications (bcrypt at 99%) and ambiguous cases (MD5 vs NTLM, both 32 hex characters). This is pattern-based identification — not definitive proof — so context matters.
Why It Matters
When you encounter an unknown hash, identifying its algorithm is the critical first step. If a system returns MD5 hashes for passwords, that's a critical vulnerability. If a legacy application uses SHA-1 for signatures, it needs migration. Security auditors, penetration testers, and incident responders all need to quickly identify hash formats to assess risk and plan remediation. This tool turns a mystery hash into actionable intelligence.
How It Works
The identifier runs a series of regex tests and length checks against the input string. It first checks for structured prefixes: bcrypt ($2a$, $2b$, $2x$, $2y$), Argon2 ($argon2i$, $argon2id$, $argon2d$), scrypt ($scrypt$), and PBKDF2 ($pbkdf2-$). These patterns are highly specific and yield 90-99% confidence. For plain hex hashes, it measures length: 32 chars = MD5, 40 = SHA-1, 56 = SHA-224, 64 = SHA-256, 96 = SHA-384, 128 = SHA-512. The tool also handles ambiguous cases like NTLM (same format as MD5) by reporting lower confidence and noting that context is needed for definitive identification.
A decision tree diagram: Input hash → Check for prefix ($2a$, $argon2id$, $scrypt$) → If prefix found, identify by prefix → If plain hex, measure length → Map length to algorithm (32=MD5, 40=SHA-1, 64=SHA-256, etc.) → Output identification with confidence score.
Step-by-Step Examples
Paste the hash: $2b$10$N9qo8uLOickgx2ZMRZoMye.8r6gJ1Y6Vz4zJk6Vz
The tool detects the $2b$ prefix immediately.
It reports: bcrypt (99% confidence) — Starts with $2b$.
The prefix encodes the algorithm variant, cost factor, and salt.
Algorithm: bcrypt | Confidence: 99% | Notes: Starts with $2b$Paste the hash: 5d41402abc4b2a76b9719d911017c592
The tool measures the length: 32 hex characters.
It reports: MD5 (95% confidence) — 32 hex characters.
Note: NTLM also produces 32 hex characters, so context matters.
Algorithm: MD5 | Confidence: 95% | Notes: 32 hex charactersPaste the hash: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
The tool measures the length: 64 hex characters.
It reports: SHA-256 (95% confidence) — 64 hex characters.
This is a high-confidence match because SHA-256 is the only common algorithm with this exact length.
Algorithm: SHA-256 | Confidence: 95% | Notes: 64 hex charactersCode Examples
function identifyHash(hash) {
const patterns = [
{ name: 'MD5', test: h => /^[a-f0-9]{32}$/i.test(h), confidence: 95 },
{ name: 'SHA-1', test: h => /^[a-f0-9]{40}$/i.test(h), confidence: 95 },
{ name: 'SHA-256', test: h => /^[a-f0-9]{64}$/i.test(h), confidence: 95 },
{ name: 'SHA-384', test: h => /^[a-f0-9]{96}$/i.test(h), confidence: 95 },
{ name: 'SHA-512', test: h => /^[a-f0-9]{128}$/i.test(h), confidence: 95 },
{ name: 'bcrypt', test: h => /^$2[abxy]$/.test(h), confidence: 99 },
{ name: 'Argon2', test: h => /^$argon2(id|i|d)$/.test(h), confidence: 99 }
];
return patterns
.filter(p => p.test(hash))
.sort((a, b) => b.confidence - a.confidence);
}Hash Algorithm Detection Patterns
| Algorithm | Length | Pattern | Confidence |
|---|---|---|---|
| MD5 | 32 hex chars | ^[a-f0-9]{32}$ | 95% |
| SHA-1 | 40 hex chars | ^[a-f0-9]{40}$ | 95% |
| SHA-224 | 56 hex chars | ^[a-f0-9]{56}$ | 90% |
| SHA-256 | 64 hex chars | ^[a-f0-9]{64}$ | 95% |
| SHA-384 | 96 hex chars | ^[a-f0-9]{96}$ | 95% |
| SHA-512 | 128 hex chars | ^[a-f0-9]{128}$ | 95% |
| bcrypt | 60 chars | ^\$2[abxy]\$ | 99% |
| Argon2 | Varies | ^\$argon2(id|i|d)\$ | 99% |
| scrypt | Varies | ^\$scrypt\$ | 99% |
| PBKDF2 | Varies | ^\$pbkdf2- | 90% |
Ambiguous Hash Formats
| Hash A | Hash B | Same Length? | How to Distinguish |
|---|---|---|---|
| MD5 | NTLM | Yes (32 chars) | Context: Windows auth = NTLM, general = MD5 |
| MD5 | CRC32 | Yes (8 bytes) | CRC32 is not cryptographic; MD5 is |
| SHA-256 | RIPEMD-256 | Yes (64 chars) | Very rare; context usually makes it clear |
| SHA-512 | SHA-512/256 | No (128 vs 64) | Length distinguishes them |
Benefits
- Instantly identifies hash type by length and pattern matching.
- Detects Argon2, bcrypt, scrypt, and PBKDF2 password hash prefixes.
- Reports confidence level to help assess identification reliability.
- Handles ambiguous cases by reporting multiple possible matches.
- Client-side operation with zero network transmission.
Use Cases
Identifying unknown hash formats encountered in penetration testing or forensic analysis.
Verifying that applications are using the expected hash algorithm for password storage.
Debugging hash comparison failures by confirming both sides use the same algorithm.
Assessing the security posture of a legacy system by identifying its hash algorithms.
Educating teams on hash format recognition for security awareness training.
Common Mistakes to Avoid
Assuming hash identification is deterministic when the same length can correspond to multiple algorithms.
Trusting identification results without verifying context — CRC32 and MD5 share the same length.
Failing to check for algorithm prefixes like $2b$ for bcrypt that immediately reveal the hash type.
Treating Base64-encoded data as a hash — check the character set for +, /, and = characters.
Using identification results as the sole basis for security decisions without source code verification.
Security Implications
Correctly identifying hash algorithms is a critical first step in security audits. If an application returns MD5 hashes for user passwords, it signals a serious vulnerability that needs immediate remediation. However, identification is probabilistic — always verify through source code review or configuration documentation. The presence of strong hash prefixes (bcrypt, Argon2) is a positive security indicator.
Security Information
Identification is performed entirely client-side. No hash values are transmitted. Hash type identification is a useful first step in security audits to verify the correct algorithm is in use. However, identification is probabilistic — always verify through source code review or configuration documentation for definitive confirmation.
Best Practices
- Use this tool to verify your application is using the expected hash algorithm.
- If an application returns MD5 hashes for passwords, it should be upgraded to bcrypt or Argon2 immediately.
- Remember that identification is probabilistic — the same length can correspond to multiple algorithms.
- Check for algorithm prefixes ($2b$, $argon2id$) for the highest confidence identifications.
- Combine hash identification with source code review for definitive security assessments.
Frequently Asked Questions
References & Further Reading
What is a Hash Identifier?
A hash identifier is a tool that determines which cryptographic hash algorithm was used to produce a given hash value. When you encounter a hash in a database dump, configuration file, or security log, you need to know the algorithm to verify its integrity or crack it. Different hash algorithms produce outputs with specific lengths and character sets, making pattern-based identification possible.
Our hash identifier uses pattern matching to analyze the hash's length, character set, prefix patterns, and formatting to identify the most likely algorithm. This is invaluable for security professionals, developers, and anyone working with encrypted or hashed data.
How Pattern Matching Identifies Hash Algorithms
Each hash algorithm produces output with distinct characteristics. MD5 always produces exactly 32 hexadecimal characters. SHA-1 produces 40 characters. SHA-256 produces 64 characters. SHA-512 produces 128 characters. These fixed lengths are the primary identification method.
For password hashing algorithms like bcrypt, Argon2, and PBKDF2, the identification relies on prefix patterns. Bcrypt hashes start with $2a$, $2b$, $2x$, or $2y$ followed by a cost factor. Argon2 hashes contain parameters like $argon2id$v=19$m=65536,t=3,p=1. These structured prefixes make identification highly reliable.
Our tool assigns a confidence score to each match. Some hash types have unique formats (bcrypt at 99% confidence), while others like NTLM and MD5 share the same 32-character hex format, requiring context to differentiate (50% confidence for NTLM).
Real-World Use Cases
Security Incident Response: When investigating a data breach, analysts encounter password hashes in leaked databases. Identifying the hash algorithm is the first step to understanding how strong the hashing was and whether the hashes can be cracked.
Database Migration: When migrating from one system to another, you need to identify existing hash formats to ensure compatibility. Different systems use different algorithms, and knowing the format prevents data loss during migration.
Penetration Testing: Security testers use hash identification to assess the security posture of a target system. Identifying weak hashing algorithms like MD5 or SHA-1 helps prioritize which credentials are most vulnerable.
Forensic Analysis: Digital forensics investigators frequently encounter hashes in evidence. Identifying the algorithm helps determine what tools and methods are needed for further analysis or decryption attempts.
Common Hash Identification Mistakes
Assuming Identification is Definitive: Pattern matching can identify hash types with high confidence, but some algorithms produce identical output formats. MD5 and NTLM both produce 32-character hex strings. Context about where the hash came from is often needed for definitive identification.
Confusing Encoding with Hashing: A Base64 string is not a hash. If you see a string with letters, numbers, +, /, and = characters, it might be Base64-encoded data, not a hash. Check the character set before assuming it is a hash value.
Ignoring Algorithm Strength: Identifying a hash is only the first step. An MD5 hash (32 chars) is weak and easily cracked, while a bcrypt hash (60 chars with salt) is extremely strong. Understanding the security implications of each algorithm is crucial.
Truncated Hashes: Some systems store only a portion of a hash for efficiency. A truncated SHA-256 hash might look like an MD5 hash. If the identification seems uncertain, consider whether the hash might be truncated.
Related Hash Tools
Explore these hash generation and analysis tools:
- SHA-256 Generator — Generate SHA-256 hashes for text and files.
- SHA Hash Tools — Multi-algorithm SHA hash generation.
- MD5 Generator — Generate MD5 hashes for file integrity checks.
- HMAC Generator — Create hash-based message authentication codes.
- Encoding Utilities — Convert between different data encoding formats.