Back to all patterns
Ethereum Address
Validation
Validates a hex-encoded Ethereum address (40 hex chars, 0x-prefixed).
/^0x[a-fA-F0-9]{40}$/How it works
Ethereum addresses are the last 20 bytes of the keccak-256 hash of a public key, displayed as 40 hex characters with a 0x prefix. EIP-55 mixed-case checksum encoding is layered on top but does not change the regex.
Test Cases
Should Match
- 0x52908400098527886E0F7030069857D2E4169EE7
- 0xde709f2102306220921060314715629080e2fb77
Should NOT Match
- 52908400098527886E0F7030069857D2E4169EE7
- 0xZZZZ400098527886E0F7030069857D2E4169EE7
Quick Summary
Matches an Ethereum address: 0x followed by 40 hex characters.