xxHash Calculator

Compute the extremely fast xxHash32/64 non-cryptographic hash

Computes XXH32 and XXH64 hashes of any text with an optional seed, returning hex and decimal output. The same blazing-fast non-cryptographic hash used by LZ4, Zstandard and many databases. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

What is xxHash?

xxHash is a non-cryptographic hash by Yann Collet known for extreme speed, often saturating memory bandwidth. It is used inside LZ4, Zstandard and many databases for fast integrity checks and keying.

xxHash is one of the fastest hash functions ever published — fast enough to saturate RAM bandwidth on a single CPU thread — which is why it powers LZ4, Zstandard, and countless databases. This calculator computes both the XXH32 and XXH64 variants with an optional seed, entirely in your browser.

How xxHash works: the striped accumulation design

Both variants follow the same structural shape, designed for CPU pipeline efficiency:

Phase 1 — striped accumulation (inputs longer than 16/32 bytes)

xxHash maintains four independent accumulators (v1–v4), each seeded from the input seed combined with constants. For every lane (4 bytes in XXH32, 8 bytes in XXH64), one accumulator absorbs a chunk through a round step:

v = v + (data * prime2)
v = rotateLeft(v, rotationAmount)
v = v * prime1

Processing four accumulators in rotation is what lets xxHash keep four CPU execution units busy simultaneously, achieving near-memory-bandwidth throughput.

Phase 2 — accumulator merging

The four accumulators are folded into a single value using rotates and additions:

h = rotl(v1, 1) + rotl(v2, 7) + rotl(v3, 12) + rotl(v4, 18)

For XXH64 each accumulator is then merged through an additional mixing step before the fold.

Phase 3 — tail bytes and length

Remaining bytes (up to 7 for XXH64, up to 3 for XXH32) are consumed in 8-byte, 4-byte, and 1-byte sub-rounds, and the total input length is added to the accumulator.

Phase 4 — finalisation avalanche

An avalanche sequence of XORs, shifts, and prime multiplications ensures every output bit depends on every input bit:

h = h XOR (h >> shift1)
h = h * prime2
h = h XOR (h >> shift2)
h = h * prime3
h = h XOR (h >> shift3)

XXH32 uses 32-bit lanes and arithmetic; XXH64 uses 64-bit lanes (BigInt in this browser tool for correctness).

xxHash constants

ConstantXXH32XXH64
Prime10x9e3779b10x9e3779b185ebca87
Prime20x85ebca770xc2b2ae3d27d4eb4f
Prime30xc2b2ae3d0x165667b19e3779f9
Seed (default)00

The constants are chosen from the golden-ratio-derived sequence floor(2^32 * phi) and its relatives — a property that ensures good bit mixing across the word width.

Reference values

InputSeedXXH32XXH64
(empty)00x02cc5d050xef46db3751d8e999
abc00x32d153ff0x44bc2cf5ad770999
hello00x9738f19b0x26c7827d889f6da3
hello420xdebc0a95(differs from seed 0)

Use abc with seed 0 to verify the tool matches the reference implementation.

Where xxHash is actually used

  • LZ4 and Zstandard — both compression formats use XXH32 or XXH64 to checksum compressed frames.
  • ClickHouse and other columnar databases — xxHash is used for sharding and deduplication of column data.
  • RocksDB / LevelDB — some configurations use XXH as an alternative to CRC32.
  • File synchronisation tools — several rsync-derivative and backup tools prefer xxHash over MD5 for its speed without the baggage of a broken cryptographic algorithm.
  • Content-defined chunking — rolling-window chunking algorithms (e.g., FastCDC) use xxHash to fingerprint chunks for deduplication.

Comparison with similar hashes

HashOutputSpeed notes
FNV-1a32 or 64 bitsOne byte at a time; slower for bulk data
MurmurHash332 or 128 bits4-byte lanes; good quality; slower than xxHash
xxHash (XXH32/64)32 or 64 bits16/32-byte lanes; near-RAM-bandwidth speed
xxHash3 (XXH3)64 or 128 bitsEven faster with SIMD; not computed here

xxHash is non-cryptographic — never use it where an adversary can engineer collisions. For security-sensitive contexts use SipHash (for keyed MACs) or SHA-256/SHA-3 (for unkeyed integrity). All computation in this tool is local; nothing is uploaded.