When a user has not uploaded a profile photo, an identicon gives them a unique visual identity for free. This generator turns any string into a clean, symmetric geometric avatar that is identical every time for the same input.
How it works
The seed string is hashed with FNV-1a, a fast 32-bit non-cryptographic hash:
hash = 0x811c9dc5
for each char:
hash = hash XOR charCode
hash = hash * 0x01000193 (32-bit)
The hash drives two things. First, hash mod 360 becomes the avatar’s hue, kept
at a fixed saturation and lightness so colors stay legible. Second, the bits of
the hash (further mixed per cell) fill a 5x5 grid. Only the left three columns
are decided independently; columns four and five mirror columns two and one, so
the result is always left-to-right symmetric. The filled cells are drawn as
colored squares on your chosen background and exported as a crisp, scalable SVG.
Notes and tips
Because the avatar is pure SVG, it scales to any size without blurring and stays tiny in file size. For best results, seed with a stable identifier such as a user ID or a lowercased, trimmed email rather than a display name that might change. You can store just the seed in your database and regenerate the avatar on demand, avoiding image storage entirely. Pair the auto-derived colors with a neutral background like light gray for a polished, app-ready look.