How to use the FNV hash calculator
- Enter your key or string in Text.
- Set Input is to Text (UTF-8), Hex bytes or Base64 bytes.
- Choose a Variant: FNV-1a 32-bit (default), FNV-1 32-bit, FNV-1a 64-bit or FNV-1 64-bit.
- Read the FNV (hex) value, the unsigned Decimal value and the Input size.
What it does and when to use it
FNV is a tiny non-cryptographic hash: one XOR and one multiply per byte. It is popular wherever speed and simplicity matter more than security, for example hash-table keys in C and Go, assigning users to shards or A/B test groups, bloom filters, and short cache keys. Use this page to check that your own implementation gives the same numbers, or to see which bucket a key will land in.
For a side-by-side view with djb2, MurmurHash3 and others, open the simple string hash table. The DJB2 calculator covers the other classic string hash, and the text to colour tool uses FNV-1a to pick a stable colour for a name.
How it works
The code in this page follows RFC 9923. It starts from an offset basis and, for each byte of input:
- FNV-1a: XOR the byte into the hash, then multiply by the FNV prime.
- FNV-1: multiply by the prime first, then XOR the byte.
Arithmetic wraps around at 32 or 64 bits.
| Size | Offset basis | Prime |
|---|---|---|
| 32-bit | 0x811C9DC5 | 0x01000193 |
| 64-bit | 0xCBF29CE484222325 | 0x100000001B3 |
The 32-bit versions use JavaScript’s 32-bit integer multiply; the 64-bit versions use BigInt so no precision is lost.
Worked examples
One letter, step by step. For a (byte 0x61), FNV-1a computes 0x811C9DC5 XOR 0x61 = 0x811C9DA4, then multiplies by 0x01000193 and keeps the low 32 bits. The tool shows FNV (hex): e40c292c, decimal 3826002220.
Reference string. foobar with FNV-1a 32-bit gives bf9cf968, decimal 3214735720, a widely used reference value for checking implementations.
64-bit FNV-1. a with FNV-1 64-bit gives af63bd4c8601b7be.
Choosing a shard. user-42 hashes to 39875499 and user-43 to 23097880. With four shards you take the decimal value modulo 4, so they go to shards 3 and 0. Neighbouring keys end up far apart, which is what you want.
Limits and tips
- Use the decimal value for modulo arithmetic; the hex value is the same number.
- If you need fewer bits, for example a 16-bit value, the FNV authors recommend XOR-folding: XOR the high half into the low half instead of just cutting bits off.
- FNV is a hash for lookups, not a checksum: it is not designed to detect transmission errors as a CRC is, and the note under the result says so.
Frequently asked questions
Should I use FNV-1 or FNV-1a?
Is FNV safe for passwords or signatures?
Why does the empty string hash to 811c9dc5?
Does it hash characters or bytes?
Sources
- RFC 9923, The FNV Non-Cryptographic Hash Algorithm — IETF, accessed 2026-10-07
How do we know nothing is uploaded? Test it yourself on the privacy proof page.