UTILS.
Private by default
#abc

Color from Text

Generate a deterministic color from any string of text.

Your files stay on this device

Files are processed in your browser, never uploaded. The site downloads code and assets to run the tools. No accounts or trackers.

Use Download to save this tool as one HTML file for offline use.

Privacy →
Click the hex output or a tile to copy it.

About this tool

Turn any text into a consistent, deterministic color by hashing it and mapping the hash to an HSL hue, all in your browser.

The text goes through a djb2-style hash: start at 5381, multiply by 33 and add each UTF-16 code unit, kept as an unsigned 32-bit number. Hue is the hash modulo 360, saturation is 60 plus a value from a shifted part of the hash (60 to 89 percent), and lightness is 45 plus another (45 to 64 percent).

Input is case-sensitive and not trimmed, so "Alice" and "alice " differ. Click the hex output or a tile to copy. With 360 x 30 x 20 possible values, different inputs can share a color.

Frequently asked questions

Will the same text always give the same color?
Yes — the text is hashed deterministically, so identical input always produces the exact same color.
What is this useful for?
It is handy for giving users, tags or labels a stable, unique accent color without storing one, such as for default avatars.
Will it match another library's colors?
Only if that library uses the same hash and ranges, so do not expect matches elsewhere.
Does spacing or case change the color?
Yes. Every character is hashed.

More tools