FNV Hash Calculator (FNV-1 / FNV-1a)
FNV is a fast, simple non-cryptographic hash popular for hash tables and quick fingerprints. Enter text or hex bytes and get all four common variants at once — FNV-1 and FNV-1a, each in 32-bit and 64-bit — in hexadecimal and decimal. It runs locally and updates as you type.
How to use the FNV Hash Calculator (FNV-1 / FNV-1a)
Type or paste your data and choose Text (encoded as UTF-8) or Hex bytes as the input type. In hex mode, spaces, commas, and 0x prefixes are ignored. The table updates live and shows four variants — FNV-1 and FNV-1a, each at 32-bit and 64-bit width — with each result in hexadecimal and decimal.
The difference between FNV-1 and FNV-1a is only the order of two operations per byte, but it changes the output entirely, so make sure you pick the variant your code or data format expects. FNV-1a is the more widely recommended of the two. The bit width sets the hash size: 32-bit fits in a single machine word and is common for hash-table indexing, while 64-bit has a far lower collision rate for fingerprinting larger key spaces. As a check, FNV-1a 32-bit of foobar is 0xbf9cf968 and FNV-1a 64-bit is 0x85944171f73967e8.
It all runs in your browser using exact integer arithmetic (the 64-bit variants use big integers internally), so results match reference implementations precisely and your data never leaves your machine.
The FNV hash family
FNV, named for its designers Glenn Fowler, Landon Curt Noll, and Phong Vo, is a family of non-cryptographic hash functions prized for being tiny, fast, and easy to implement in a few lines of code. It is a workhorse of hash tables, bloom filters, checksums, and quick content fingerprints — anywhere you need to turn a string or blob of bytes into a well-distributed integer and do not need protection against an adversary. Many language runtimes and libraries have used an FNV variant for their default string hashing because it has good dispersion and almost no setup cost.
The algorithm is strikingly simple. It starts from a fixed offset basis and processes one byte at a time using two operations: a multiply by a fixed FNV prime and an XOR with the byte. The two named variants differ only in the order of those steps. FNV-1 multiplies first and then XORs the byte; FNV-1a XORs the byte first and then multiplies. That single swap meaningfully improves the avalanche behavior — how much the output changes when one input bit changes — which is why FNV-1a is the version usually recommended today. The offset basis and prime are specific constants chosen for each bit width; for the 32-bit hash the prime is 16,777,619 and the basis is 2,166,136,261, and the 64-bit version uses correspondingly larger values, with all arithmetic wrapping at the chosen word size.
Choosing a width is a trade-off between speed, storage, and collision resistance. A 32-bit hash is compact and fast and is fine for in-memory hash-table buckets where occasional collisions are handled by chaining, but with only about four billion possible values, collisions become likely once you hash millions of keys (the birthday bound). A 64-bit hash makes accidental collisions vanishingly rare for most practical datasets, at the cost of a wider value. Whichever you pick, it is essential to remember that FNV is not cryptographic: it is fast precisely because it lacks the mixing that resists attacks, so it is easy to deliberately engineer inputs that collide. Never use it for passwords, signatures, or anything security-sensitive — reach for SHA-256 or BLAKE3 there. For its intended jobs of indexing and accidental-collision avoidance, FNV remains a clean, dependable choice.
Common use cases
- Hash tables. Generate a fast, well-distributed integer key for bucketing strings or bytes.
- Fingerprinting. Produce a compact 64-bit fingerprint to detect duplicate or changed content.
- Matching implementations. Reproduce an FNV value computed elsewhere to confirm your code agrees.
- Learning. Compare FNV-1 versus FNV-1a and 32- versus 64-bit output for the same input.