Color Converter (HEX, RGB, HSL)→Specialized Version
🎨

Color Name to HEX

Color name to HEX

Tailwind in
slate-500
HEX out
#4682B4
RGB
HSL

All formats

Lightness variations

Color Name to HEX Converter

Convert CSS color names to their HEX code equivalents. CSS supports over 140 named colors that can be used directly in stylesheets, and this converter helps you find the exact HEX code for any named color.

Common CSS Color Names

Color NameHEX CodeRGB
red#FF0000rgb(255, 0, 0)
blue#0000FFrgb(0, 0, 255)
green#008000rgb(0, 128, 0)
yellow#FFFF00rgb(255, 255, 0)
purple#800080rgb(128, 0, 128)
orange#FFA500rgb(255, 165, 0)
pink#FFC0CBrgb(255, 192, 203)
cyan#00FFFFrgb(0, 255, 255)

Gray Scale Colors

NameHEXValue
white#FFFFFFLightest
whitesmoke#F5F5F5
gainsboro#DCDCDC
lightgray#D3D3D3
silver#C0C0C0
darkgray#A9A9A9
gray#808080Middle
dimgray#696969
black#000000Darkest

Using Named Colors

``css .element { color: crimson; /* Same as */ color: #DC143C; } `

Use this converter to find the precise HEX code for any of CSS's 140+ named colors.

A Full Ramp From This Colour

Design systems settle on a 50–900 scale because it covers backgrounds, borders, text and states without anyone reaching outside the palette. Mixing toward white and black rather than adjusting HSL lightness keeps more of the hue's character:

StepColourContrast on whiteSafe for
50#F5F9FF1.06:1backgrounds and fills
100#EBF3FE1.12:1backgrounds and fills
200#CEE0FD1.34:1backgrounds and fills
300#B1CDFB1.62:1backgrounds and fills
400#76A8F92.40:1backgrounds and fills
500#3B82F63.68:1large text, borders
600#326FD14.85:1body text on white
700#295BAC6.59:1body text on white
800#2048878.98:1body text on white
900#18346212.31:1body text on white
The contrast column is the one that decides usage. Steps below 3:1 cannot carry text at any size and belong in fills and dividers; steps at 4.5:1 and above are safe for body copy.

Adjusting It

Base colour in HSL is hsl(217, 91%, 60%). Two useful moves:

`css /* +10% lightness, same hue */ --lighter: #6da2f8; /* −10% lightness */ --darker: #0b64f4; `

Raising lightness also drops perceived saturation, so a lightened colour reads greyer than its numbers suggest. Adding 5–10% saturation alongside every 20% of lightness keeps the ramp looking like one hue rather than a fade to grey.

The 148 CSS Colour Keywords

CSS defines a fixed list — 148 names covering 147 distinct colours, since gray and grey (and aqua/cyan, magenta/fuchsia) are aliases.

NameHEXNote
red#FF0000Full intensity
green#008000Half intensity — lime is #00FF00
blue#0000FFFull intensity
purple#800080Half intensity
gray / grey#808080Both spellings valid
aqua / cyan#00FFFFIdentical
rebeccapurple#663399Added in 2014 in memory of Rebecca Meyer
The green trap catches people repeatedly: the keyword is the dark VGA green, and the bright one everybody pictures is lime.

Why Not to Use Them in Production

Named colours are excellent for prototyping and debugging — border: 1px solid red while you find a layout problem — and poor as a design system.

  • You get 148 and no more. Any brand colour needs a hex value anyway.
  • They carry no semantics. tomato tells a reader nothing about what it is for;
--color-danger does.
  • There are no ramps. darkblue is not a computed shade of blue — it is an
unrelated fixed value, so the two do not form a scale.

Define tokens instead:

`css :root { --color-danger: #dc2626; --color-danger-bg: #fef2f2; } ``

One place to change, a name that survives a rebrand, and a ramp you control.

Frequently Asked Questions

What color names work?

CSS supports 140+ named colors including red, blue, coral, crimson, etc.

Are CSS color names case-sensitive?

No. Red, RED and red all resolve to the same colour. CSS keywords are ASCII case-insensitive, and both gray and grey are accepted spellings of #808080.

Should I use names or HEX?

HEX is more precise and universally supported. Names are convenient for common colors.

Related Tools

Explore other tools you might find useful:

More Color Converter (HEX, RGB, HSL) tools

You might also need