Color From Text Hash

Turn any string into a consistent, repeatable color.

Ad placeholder (leaderboard)
Enjoying the tools? Go Pro for £4.99 (one-time) and remove all ads — forever, on this device. Remove ads — £4.99

This tool maps any text — a username, tag, email or category name — to a stable color that looks identical on every render. It is the trick behind colored avatar backgrounds, label chips and chart series, where you want each name to have a consistent, recognisable color without storing one. Type a string and get its HEX, RGB and HSL values plus a live swatch.

How it works

The text is run through a deterministic FNV-1a 32-bit hash, so identical input always produces the same hash. That hash is mapped to an HSL color: the hue is hash mod 360 (the full color wheel), while different bits of the hash set the saturation (constrained to 55-89%) and lightness (40-64%) to keep colors vivid but not garish. The HSL value is then converted to RGB and HEX. Finally, the tool measures the color’s relative luminance and picks black or white label text for good contrast.

Example

TextHue (hash mod 360)Result style
”alice”a fixed huealways the same teal-ish swatch
”bob”a different huealways the same orange-ish swatch

Because the mapping is deterministic, “alice” produces the exact same HEX every single time, on every device — ideal for consistent avatar colors. All computation happens in your browser.

Ad placeholder (rectangle)