Introduction
Need to reproduce a hash bucket value from a Go map, a Rust HashMap, or a custom hash table? FNV-1a is a fast non-cryptographic hash designed by Glenn Fowler, Landon Curt Noll, and Kiem-Phong Vo in 1991 while they were working at Bell Labs. It is one of the simplest hash functions to implement and shows up in NFS file handles, DNS transaction IDs, the Go standard library, and countless bloom filters. This fnv hash generator computes FNV-1a in six widths from 32 to 1024 bits. Paste your text and the hash appears instantly. No data leaves your browser.
What this tool does
- Computes FNV-1a in 32, 64, 128, 256, 512, and 1024-bit widths.
- Outputs the hash as a zero-padded lowercase hex string matching the bit width.
- Processes input as UTF-8 bytes, the same convention used by the reference implementation.
- Updates the hash in real time as you type or switch variants.
- Uses BigInt arithmetic for the 128-bit and larger variants so results match the spec exactly.
- Runs entirely client-side with no network requests.
How this tool works
Pick a variant from the dropdown. The 32-bit and 64-bit variants are the ones you will see most often in real codebases; the larger variants exist mainly for systems that need a wider hash with no collision risk at scale. Type or paste text into the input field. The hash appears instantly in the output field as a hex string.
The tool encodes your input as UTF-8 bytes and feeds each byte into the FNV-1a loop. There is no seed parameter because FNV-1a does not use one. The offset basis and prime are hardcoded per variant, taken from the official FNV specification. Results match the reference C implementation published by Landon Noll.
How FNV-1a works
FNV-1a is named after its authors (Fowler, Noll, Vo) and the "1a" variant, which differs from the original FNV-1 by XORing the byte into the hash before multiplying by the prime. That swap improves avalanche behavior for short inputs.
The algorithm is two lines of code per byte:
1. hash = hash XOR byte 2. hash = hash * FNV_prime
The hash starts at an offset basis that is specific to each bit width. For 32-bit the offset is 0x811c9dc5 and the prime is 0x01000193. For 64-bit the offset is 0xcbf29ce484222325 and the prime is 0x100000001b3. The full list of constants for every width from 32 to 1024 bits is published in the FNV specification maintained by Landon Noll.
FNV-1a is not cryptographic. It has no resistance to deliberate collision attacks, and an attacker can find two inputs that hash to the same value with very little work. Use it for hash tables, bloom filters, checksums, and content addressing where speed matters and adversaries do not. For password storage, signatures, or tamper detection, use SHA-256, BLAKE2, or SHA-3.
How to use this tool
- Select the FNV-1a variant from the dropdown. 32-bit and 64-bit cover most real-world uses.
- Type or paste the text you want to hash into the input field.
- The hex hash appears instantly in the output field. Copy it with the Copy button.
- Switch variants to compare widths without retyping your input.
Real-world examples
Reproducing a Go map bucket hash
Go's runtime uses a variant of FNV-1a internally for some hashing paths, and many Go tutorials reference FNV-1a for custom hash tables. A developer debugging a Go map with string keys wants to verify which bucket a key lands in. Input: the key string. Output: the 64-bit FNV-1a hash that the bucket selection logic would consume.
Bloom filter with multiple FNV widths
A bloom filter needs k independent hash functions. Because FNV-1a has six standard widths, you can run the same input through the 32, 64, and 128-bit variants and treat each output as a separate hash. Input: "user@example.com". Outputs: three different hex strings you can mod against the bit array length to get k bit positions.
Checksum for short configuration strings
A build system stores short config snippets in a cache keyed by their FNV-1a 64-bit hash. The developer wants to verify a cache hit without running the full build. Input: the config string. Output: a 16-character hex hash that matches the key in the cache manifest. FNV-1a 64-bit is fast enough to compute inline and has a low collision rate for inputs under a few kilobytes.
Comparison with similar methods
| Method | Complexity | Typical use |
|---|---|---|
| FNV-1a 32-bit | O(n), one XOR and one multiply per byte | Hash tables, Go, NFS file handles |
| FNV-1a 64-bit | O(n), one XOR and one multiply per byte | 64-bit hash maps, bloom filters |
| MurmurHash3 32-bit | O(n), multiply-rotate-finalize | Cassandra, HBase, Guava |
| xxHash64 | O(n), faster than FNV and Murmur | Linux kernel, LZ4, Rust |
Limitations or considerations
FNV-1a is a non-cryptographic hash. It is not designed to resist deliberate collision attacks, and an attacker can find collisions efficiently. Do not use FNV-1a for password hashing, digital signatures, HMAC, or tamper detection. For those use cases, use SHA-256, BLAKE2, or SHA-3. The 32-bit variant has a birthday collision bound of about 77,000 items (2^16), so it is unsuitable for collections larger than that. The 64-bit variant is safe up to roughly 4 billion items. The 128-bit and larger variants use BigInt arithmetic and are slower than the 32-bit and 64-bit variants, which use native Number math.
Frequently asked questions
What is the difference between FNV-1 and FNV-1a?
FNV-1 multiplies by the prime first, then XORs the byte into the hash. FNV-1a XORs the byte first, then multiplies. The 1a variant has better avalanche characteristics for short inputs and is the one most libraries implement. The constants (offset basis and prime) are the same for both variants at a given width.
Why does FNV-1a have no seed parameter?
The original FNV design does not include a seed. The offset basis is fixed per width. If you need a seeded hash for a bloom filter or to randomize hash table behavior, prepend your seed bytes to the input, or use MurmurHash3 or xxHash which both accept a seed natively.
Can I use FNV-1a for password hashing?
No. FNV-1a is not resistant to collision attacks and has no salt or work factor. Use bcrypt, Argon2, or scrypt for password hashing. FNV-1a is appropriate for hash tables, checksums, and bloom filters where speed matters and adversaries are not a concern.
Why does my FNV-1a value not match another tool?
Check the variant width first. A 32-bit FNV-1a of the same input will not match a 64-bit result. Then check the encoding: this tool hashes UTF-8 bytes, which matches the reference implementation. Some older tools hash 16-bit code units or treat input as Latin-1, which produces different results for non-ASCII input.
Conclusion
This fnv hash generator covers all six standard FNV-1a widths from 32 to 1024 bits and matches the reference constants published by Landon Noll. Use it to reproduce hashes from Go, Rust, or any system that uses FNV-1a for hash tables and bloom filters. For other fast non-cryptographic hashes, try the MurmurHash3 or xxHash tools. For cryptographic hashes, use the SHA-256 or BLAKE2 tools.