Hash → Color

Deterministic color from any string.

Open tool

Overview

The Hash → Color tool turns any string — a username, a project ID, a tag name, a UUID — into a stable, deterministic colour. The same input always returns the same hex, so you can colour-code avatars, tags or row chips without storing a palette mapping.

It is useful for generating placeholder avatars, building auto-coloured tag systems, distinguishing rows in a logs viewer, or assigning chart series colours by category name. Because the algorithm is one-way and pure, the same colour appears on every client without any coordination.

How it works

The input is hashed with a fast non-cryptographic function (FNV-1a or similar) into a 32-bit integer. The integer is reduced modulo 360 to pick a hue, while saturation and lightness are either fixed at design-friendly defaults (around 65% / 55%) or derived from further bits of the hash to add a controlled amount of variety.

Working in HSL guarantees that every generated colour has a usable lightness for text or chip backgrounds. Optionally, the tool can clamp the hue away from a "forbidden" region (for example, avoiding reds for non-error contexts) by remapping the modulo range.

Examples

"alice"     → #4ea871  hsl(146, 41%, 48%)
"bob"       → #c25a72  hsl(347, 50%, 56%)
"product-3" → #5079c4  hsl(217, 50%, 54%)
"team-ops"  → #aa8a39  hsl( 43, 51%, 45%)

FAQ

Is the colour cryptographically random?

No — it is deterministic and the hash is not cryptographic. Anyone with the input can reproduce the colour. That is the whole point: the colour is a function of the string.

Will similar inputs produce similar colours?

No, by design. Avalanche in the hash function means alice and alicd will hash to wildly different integers and therefore different hues.

How do I keep the result readable on a white background?

Fix the lightness to around 40–55% and the saturation to around 50–70%. The default settings already target that range; tweak them if your background colour is unusual.

Can I bias the palette away from certain colours?

Yes — restrict the hue range, for example to 200–280° if you only want blues and purples, or skip a band around red if reds are reserved for error states.

Is the output collision-free?

With only 360 hues there will be collisions on any non-trivial input set. Combining the hue with a few discrete lightness steps roughly doubles the effective palette size.

Try Hash → Color

An unhandled error has occurred. Reload ×