FNV-1a Hash Calculator

Compute the fast non-cryptographic FNV-1a hash

Computes the FNV-1a (Fowler-Noll-Vo) non-cryptographic hash of any text in both 32-bit and 64-bit variants, showing hex and decimal output. Ideal for hash tables, checksums and quick keying. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

What is the FNV-1a hash?

FNV-1a is a fast non-cryptographic hash by Fowler, Noll and Vo. For each input byte it XORs the byte into the hash and then multiplies by a fixed FNV prime, all modulo 2^32 or 2^64.

FNV-1a (Fowler-Noll-Vo variant 1a) is one of the simplest fast hash functions in wide use, valued for hash tables, bloom filters, and quick content keying. This calculator computes both the 32-bit and 64-bit FNV-1a hashes of your text directly in the browser, with copy buttons for each result.

How FNV-1a works

FNV-1a processes the input one byte at a time with just two operations per byte:

  1. Initialise the hash to the FNV offset basis — 2166136261 (0xcbf29ce4) for 32-bit, 14695981039346656037 (0xcbf29ce484222325) for 64-bit.
  2. For each byte: XOR the byte into the hash first, then multiply by the FNV prime, keeping the result modulo 2^32 or 2^64.
  3. The final accumulated value is the hash.

The “a” suffix signals the XOR-before-multiply order. The original FNV-1 multiplied first and XOR’d second — FNV-1a’s swap improves the avalanche behaviour for inputs that differ in only a few bytes.

FNV primes:

  • 32-bit: 16777619 (0x01000193)
  • 64-bit: 1099511628211 (0x00000100000001b3)

These primes were chosen so that the multiply scatters bits across the full word width before the XOR re-mixes them.

Reference values

Input32-bit FNV-1a64-bit FNV-1a
(empty)0x811c9dc50xcbf29ce484222325
hello0x4f9f2cab0xa430d84680aabd0b
foobar0xbf9cf9680x85944171f73967e8

The empty-string value equals the offset basis in both variants because no XOR or multiply is performed. Use hello to verify the tool matches your own implementation.

FNV-1 vs FNV-1a — a concrete example

With the byte 0x41 (ASCII A) and a 32-bit starting state of 0x811c9dc5:

FNV-1  (multiply, then XOR):
  hash = (0x811c9dc5 * 16777619) & 0xffffffff = 0x050c5d2f
  hash = 0x050c5d2f XOR 0x41                  = 0x050c5d6e

FNV-1a (XOR, then multiply):
  hash = 0x811c9dc5 XOR 0x41                  = 0x811c9d84
  hash = (0x811c9d84 * 16777619) & 0xffffffff = 0x4f9f2cab (first byte of "hello")

The swap means an input change immediately participates in the multiply, spreading its influence across more output bits with each subsequent byte.

Where FNV-1a shows up in real systems

  • DNS resolvers — several BIND and Unbound versions have used FNV internally for cache keying.
  • Programming language runtimes — Rust’s standard library and many scripting language implementations have shipped FNV maps as a default or alternative.
  • Bloom filters — FNV-1a’s speed and good distribution make it popular for generating multiple independent hash seeds from a single key (e.g., by using different offset bases or seeding tricks).
  • Protocol buffers and serialisation — FNV fingerprints appear in some protobuf-adjacent tooling for field name hashing.

Limitations and security warning

FNV-1a is not cryptographically secure. A determined attacker can construct inputs with deliberate collisions, enabling hash-flooding attacks against hash tables that use FNV-1a without a random seed. If the hash table accepts untrusted keys (for example, from HTTP request headers or query strings), use SipHash or a keyed hash instead. Never use FNV-1a for passwords, tokens, or digital signatures.

The 64-bit variant uses BigInt arithmetic in this tool so that all 64 bits remain accurate; JavaScript’s standard 53-bit number representation would silently lose the high bits otherwise.