PB
Available
security
lock Free · Private · In-Browser

FNV-1a 32-bit Hash Generator

Generate the fast non-cryptographic FNV-1a fingerprint for text.

  

XOR each byte before multiplying by the FNV prime

FNV-1a 32-bit hashing begins with offset basis 811c9dc5, XORs each UTF-8 byte into the state, and multiplies modulo two to the thirty-second by prime 01000193. This compact sequence is popular in hash tables, file formats, and deterministic identifiers where speed and reproducibility matter more than resistance to deliberate collisions.

The text hello produces 4f9f2cab under the standard 32-bit parameters. JavaScript's integer multiplication must preserve low 32-bit behavior, so this implementation uses Math.imul and unsigned normalization after every step. Case, encoding, and every whitespace byte affect the result; Hello therefore does not share the same fingerprint as hello.

Use FNV-1a for tables and compatibility, not trust

FNV-1a is not a cryptographic hash and attackers can construct collisions or reverse small input spaces. Do not use it for passwords, signatures, secure integrity, or untrusted deduplication. Hashing happens in your browser. When interoperating, confirm the width, FNV-1 versus FNV-1a ordering, offset basis, prime, byte encoding, and displayed endianness.

Frequently Asked Questions

What is the difference between FNV-1 and FNV-1a?

FNV-1 multiplies before XOR, while FNV-1a XORs each byte before multiplying.

Why does this use Math.imul?

It preserves the low 32-bit multiplication behavior needed by the algorithm despite JavaScript floating-point numbers.

Can FNV-1a verify an untrusted download?

No. It is non-cryptographic and does not resist intentional collision or tampering attacks.

Take it further
All Free Tools

Browse the full set of free, private, in-browser tools.

Learn More arrow_forward