Introduction
Need to reproduce an xxHash value from a Rust program, a Linux kernel module, or an LZ4 frame header? xxHash is an extremely fast non-cryptographic hash function created by Yann Collet in 2012. It consistently outperforms MurmurHash3 and CityHash in benchmark tests while maintaining excellent distribution quality. This tool computes both xxHash32 and xxHash64 with a configurable seed. Paste your text and get the hex hash instantly. All processing happens in your browser.
What this tool does
- Computes xxHash32 (32-bit, 8 hex chars) and xxHash64 (64-bit, 16 hex chars) with a configurable seed.
- Processes input as a UTF-8 string, matching the reference implementation.
- Updates the hash in real time as you type or change the seed.
- Outputs lowercase hexadecimal by default for easy comparison with other tools.
- Runs entirely client-side with no network requests.
How this tool works
Select xxHash32 or xxHash64 from the variant dropdown. Enter a seed value (any 32-bit integer, default 0). Type or paste text into the input field. The hash appears instantly in the output field as a hexadecimal string. xxHash32 produces 8 hex characters; xxHash64 produces 16 hex characters. Copy the result with one click.
How xxHash works
xxHash processes input in 16-byte (xxHash32) or 32-byte (xxHash64) stripes. The algorithm uses four or five accumulator lanes that are independently updated with multiply-and-rotate operations, then merged at the end.
For xxHash32, each 16-byte stripe is split into four 4-byte lanes. Each lane is multiplied by a distinct prime constant (PRIME32_1 through PRIME32_4), rotated left by 13 to 17 bits, and added to an accumulator. The accumulators are initialized to seed + PRIME32_1 + PRIME32_2, seed + PRIME32_2, seed, and seed - PRIME32_1. After all stripes are processed, the accumulators are merged using multiplication, rotation, and addition. A final avalanche step (multiply, XOR, multiply) ensures good bit distribution.
xxHash64 follows the same structure but uses 64-bit arithmetic, five accumulators, and 64-bit prime constants (PRIME64_1 through PRIME64_5). It processes 32-byte stripes (five 8-byte lanes) and uses 31-bit rotations.
The prime constants are chosen to have good bit mixing properties: PRIME32_1 = 2654435761 (a fractional part of the golden ratio), PRIME32_2 = 2246822519, PRIME32_3 = 3266489917, PRIME32_4 = 668265263, PRIME32_5 = 374761393.
xxHash is used in the Linux kernel (for hash tables in the `xxhash` module), in LZ4 (for frame checksums), in the Rust standard library (as `std::hash::DefaultHasher` since Rust 1.0 uses SipHash, but xxHash is used in many Rust crates), and in Facebook/Meta's internal infrastructure. The xxHash3 variant (released in 2019) is even faster, using SIMD operations, but this tool implements the original xxHash32 and xxHash64 for compatibility with existing systems.
How to use this tool
- Select xxHash32 or xxHash64 from the variant dropdown.
- Enter a seed value if needed (default is 0).
- Type or paste the text you want to hash into the input field.
- The hash value appears instantly as a hexadecimal string. Copy it with the Copy button.
Real-world examples
Verifying an LZ4 frame checksum
LZ4 frames can optionally include an xxHash32 content checksum. After decompressing an LZ4 frame, a developer computes xxHash32 over the decompressed data and compares it against the checksum stored in the frame footer. Input: the decompressed payload. Output: an 8-character hex string that should match the frame's checksum.
Matching a Rust xxHash call
A Rust developer uses the `xxhash-rust` crate to hash a cache key and needs to verify the output from the browser. She selects xxHash64, enters the same seed (42), and pastes the same input string. The 16-character hex output matches the Rust u64 value (converted to hex).
Linux kernel hash table debugging
A kernel module developer uses xxHash for a custom hash table and needs to verify the hash values during debugging. She selects xxHash32, enters seed 0, and pastes the key string. The output matches the value printed by the kernel's `xxh32()` function call.
Comparison with similar methods
| Method | Complexity | Typical use |
|---|---|---|
| xxHash32 | O(n), 4-lane multiply-rotate, 32-bit | LZ4, Linux kernel, fast hash tables |
| xxHash64 | O(n), 5-lane multiply-rotate, 64-bit | Rust, large hash tables, file checksums |
| MurmurHash3 32-bit | O(n), multiply-rotate, 32-bit | Cassandra, Guava, Bloom filters |
| CRC32 | O(n), table-driven, 32-bit | Ethernet, PNG, zlib |
Limitations or considerations
xxHash is a non-cryptographic hash function. It is not designed to resist deliberate collision attacks and should not be used for security-sensitive purposes like password hashing, digital signatures, or tamper detection. For those use cases, use SHA-256 or BLAKE2. The 32-bit variant has a collision probability of approximately 1 in 4 billion for random inputs, which becomes significant for data sets larger than about 77,000 items (birthday bound). This tool implements xxHash32 and xxHash64, not the newer xxHash3 variant.
Frequently asked questions
Is xxHash faster than MurmurHash3?
Yes, in most benchmarks xxHash outperforms MurmurHash3 by 20-30% on modern processors. xxHash3 (not implemented here) is even faster, using SIMD operations to achieve speeds exceeding 10 GB/s on modern hardware.
What is the difference between xxHash32 and xxHash64?
xxHash32 produces a 32-bit hash (8 hex characters) and uses four accumulator lanes with 16-byte stripes. xxHash64 produces a 64-bit hash (16 hex characters) and uses five accumulator lanes with 32-byte stripes. They produce different values for the same input. Use xxHash64 if you need a lower collision probability.
Can I use xxHash for cryptographic purposes?
No. xxHash is not designed to resist intentional collision attacks. Use SHA-256, SHA-3, or BLAKE2 for cryptographic hashing.
Does this tool support xxHash3?
No, this tool implements xxHash32 and xxHash64 using the xxhashjs library. xxHash3 requires SIMD operations that are not easily available in JavaScript. If you need xxHash3, use a native implementation or a WASM build.
Conclusion
This xxHash tool gives you both xxHash32 and xxHash64 with configurable seeds, matching the reference implementation used by LZ4, the Linux kernel, and Rust projects. For other fast non-cryptographic hashes, try the MurmurHash3 tool or the CRC64 Calculator.