Skip to main content
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 PatternName / ComponentFunction & Rule
^[a-fA-F0-9]{64}$64 Hex DigitsExact 64 hex characters.

Frequently Asked Questions

Where is SHA-256 used?
Widely used in SSL/TLS certificates, Bitcoin blockchain, package integrity checksums, and git commits.
Browse All 40 Patterns