Zero Signup ToolsFree browser tools

Generator Tools

String to Color

Turn any text into a consistent color that never changes. Map usernames, tags, or labels to hex, RGB, HSL, and OKLCH, with the readable text color for each.

String to color generator

Palette

Mid saturation and lightness. A safe default for labels and avatars.

Rotates every generated hue by the same amount. Output stays deterministic: the same string and settings always give the same color. Use this to shift a whole set away from clashing brand colors.

Single string

alex@example.com#2dd72dReadable text: black

Hash

FNV-1a 32-bit: 2570459880 (0x99361ae8)

Hex#2dd72d
RGBrgb(45, 215, 45)
HSLhsl(120, 68%, 51%)
OKLCHoklch(76.70% 0.2426 142.75)

Text contrast on this color

White text1.93:1Fail
Black text10.87:1AAA

Batch list

One string per line. Each gets its own stable color. Duplicates are shown once.

  • alice#2b2ec5
  • bob#9d38c2
  • carol#c6342f
  • dave#d89146
  • erin#cd793c
  • frank#d89b46
  • grace#abbc2f
  • heidi#c28824

Export

Copy every mapping in one format.

:root {
  --color-alice: #2b2ec5;
  --color-bob: #9d38c2;
  --color-carol: #c6342f;
  --color-dave: #d89146;
  --color-erin: #cd793c;
  --color-frank: #d89b46;
  --color-grace: #abbc2f;
  --color-heidi: #c28824;
}

Colors are computed from your text in the browser with a fixed formula, so the same string and settings always produce the same color. Nothing is uploaded.

How to use

  1. Type a username, tag, email, or any text in the single string box to see its stable color.
  2. Pick a palette such as Balanced, Pastel, Vivid, Dark, Light, or Muted to set the saturation and lightness range.
  3. Drag the hue shift slider to rotate every color while keeping each result deterministic.
  4. Read the hex, RGB, HSL, and OKLCH values and the WCAG contrast for black and white text, then copy what you need.
  5. Paste a list in the batch box, one string per line, and export every mapping as CSS variables, JSON, or CSV.

About this tool

String to Color maps any piece of text to a color using a fixed formula, so the same input always returns the same color. That repeatability is the whole point and is what separates this from a random color generator: it is meant for cases where a value needs a stable color every time it appears, such as a colored avatar for each username, a chip color for each tag or category, an event color in a calendar, a series color in a chart, or a consistent color for an id in logs and dashboards. The tool hashes the UTF-8 bytes of your text with the FNV-1a 32-bit algorithm, a fast non-cryptographic hash that is well distributed for short strings, then derives a hue from the hash and reads saturation and lightness from the palette window you pick. Six palettes are included: Balanced for general labels and avatars, Pastel for soft tints on light backgrounds, Vivid for energetic chart accents, Dark for white text on dark interfaces, Light for chips with dark text, and Muted for calm, desaturated dashboards. A hue shift slider rotates every generated hue by the same amount so you can move a whole set away from a clashing brand color while keeping every result deterministic. For a single string the tool shows the color preview with the exact FNV-1a hash, the value in hex, RGB, HSL, and OKLCH each with its own copy button, and the WCAG 2.x contrast ratio of both black and white text on that color so you can see which foreground is readable; the preview automatically uses whichever of black or white has the higher contrast. A batch mode takes a list of strings, one per line, de-duplicates repeated values, and renders a stable color for each as a labeled swatch with a two-letter monogram, then lets you export the whole mapping as CSS custom properties, JSON, or CSV ready to drop into a stylesheet or a data layer. An empty string still produces a valid color, and the FNV-1a hash is used only to choose a color, not for security or integrity. Everything runs in your browser. Your text is never uploaded.

Free to use. Works in your browser. No signup, no login.

Related tools

You may also like

All tools
All toolsGenerator Tools