Authentication & Security · In-Browser Regular Expression Lab
SHA-256 Hash Regex — Validate 64-Character Hexadecimal Hashes
Matches 64-character hexadecimal SHA-256 cryptographic digest strings.
Flags:
//none
Match Found
Load Sample:
Match Inspection & Details1 match
Match #1:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
Test Samples Verification Matrix
Expected Valid Samples (Should Match)
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 Pass
Expected Invalid Samples (Must Reject)
e3b0c44298fc1c149afbf4c8996fb924 Rejected (Pass)
invalid_hash_string Rejected (Pass)
Code Implementation Generator
// JavaScript / TypeScript (ES6+)
const pattern = /^[a-fA-F0-9]{64}$/;
const text = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
const isMatch = pattern.test(text);
console.log("Is Match:", isMatch);
if (isMatch) {
const matches = text.match(pattern);
console.log("Matches:", matches);
}Regular Expression Token Breakdown
SHA-256 digests are exactly 256 bits represented as 64 hex characters. Each component of the regular expression serves a distinct syntactical purpose as mapped below:
| Token Pattern | Name / Component | Function & Rule |
|---|---|---|
| ^[a-fA-F0-9]{64}$ | 64 Hex Digits | Exact 64 hex characters. |
Frequently Asked Questions
Where is SHA-256 used?
Related Regular Expressions
Browse All 40 PatternsAuthentication & Security
MD5 Hash Checksum
Matches 32-character hexadecimal MD5 hash checksum strings.
/^[a-fA-F0-9]{32}$/Test regex
Code & Markup
Git Commit SHA-1 & SHA-256
Matches Git commit SHA hashes: 7-character short commit IDs or 40-character full SHA-1 hashes.
/^\b([a-f0-9]{7}|[a-f0-9]{40})$/iTest regex
Data & Formatting
UUID v4 Identifier
Strictly matches version 4 UUIDs with 36 canonical characters including hyphens and version bit 4.
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/Test regex