FNV hash calculator — FNV-1 and FNV-1a in 32 and 64 bits

Enter a string or bytes and get its Fowler–Noll–Vo hash, the small, fast hash used for hash tables, bucketing and cache keys, in any of the four common variants.

Live demo · real result from this tool
FNV (hex)048fff90
Decimal
76545936
Input size
43 bytes

FNV is a fast non-cryptographic hash for hash tables, caches and deduplication. It is not a checksum with error-detection guarantees (use CRC-32 for that) and not a security hash — anyone can forge data with a chosen value.

Processed on your device — nothing is uploaded.

How to use the FNV hash calculator

  1. Enter your key or string in Text.
  2. Set Input is to Text (UTF-8), Hex bytes or Base64 bytes.
  3. Choose a Variant: FNV-1a 32-bit (default), FNV-1 32-bit, FNV-1a 64-bit or FNV-1 64-bit.
  4. 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?
FNV-1a in most cases. Mixing the byte in before the multiply spreads the last bytes of the input better, and it is what most libraries mean by "FNV". Use FNV-1 only to match an existing system.
Is FNV safe for passwords or signatures?
No. RFC 9923 itself says it is not suitable where collisions must be hard to find. An attacker can craft many keys with the same FNV hash, which can also slow down a hash table that faces the internet. Use SHA-256 for integrity and a keyed hash such as SipHash for exposed hash tables.
Why does the empty string hash to 811c9dc5?
That is the 32-bit offset basis, the starting value before any byte is processed. With no bytes, it is returned unchanged. The 64-bit basis is cbf29ce484222325.
Does it hash characters or bytes?
Bytes. Text is encoded as UTF-8 first, so "é" contributes two bytes. Libraries that hash UTF-16 code units, as some C# and Java snippets do, will give different results for the same text.

Sources

  1. RFC 9923, The FNV Non-Cryptographic Hash Algorithm — IETF, accessed 2026-10-07

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close