Color Conversion Tools

Color Name to HEX

Look up the HEX code of any CSS color keyword, such as rebeccapurple, tomato or steelblue. Start typing to choose from all 148 names, then copy the exact six-digit code.

Color Name to HEX

Edit a channel and see the color result immediately.

Swap direction

Enter CSS color name

Type a standard CSS color name, such as steelblue or rebeccapurple.

HEX result

Source color
Result color
#4682b4

RGB channels are 8-bit integers, so reverse conversion may round slightly.

The conversion runs in your browser.

All formats

HEX
#4682b4
RGB
rgb(70, 130, 180)
HSL
hsl(207.3, 44%, 49%)
HSV
hsv(207.3°, 61.1%, 70.6%)
CMYK
cmyk(61.1%, 27.8%, 0%, 29.4%)
OKLCH
oklch(58.8% 0.099 245.7)
CSS
steelblue

Tints and shades

Text contrast (WCAG)

Aa4.11:1On whiteLarge text only
Aa5.11:1On blackAA

Normal text needs 4.5:1 for AA and 7:1 for AAA; large text needs 3:1.

How it was calculated

  1. steelblue = #4682b4 = rgb(70, 130, 180) (CSS Color 4)
  2. R: 70 = 4 × 16 + 6 → 46
  3. G: 130 = 8 × 16 + 2 → 82
  4. B: 180 = 11 × 16 + 4 → B4
  5. HEX = #4682B4

Common colors in CSS color name and HEX

Choose a color to load it into the converter.

ColorCSS color nameHEX
black#000000
white#ffffff
red#ff0000
lime#00ff00
blue#0000ff
yellow#ffff00
aqua#00ffff
fuchsia#ff00ff
gray#808080
maroon#800000
green#008000
navy#000080
orange#ffa500
steelblue#4682b4
rebeccapurple#663399
tomato#ff6347

How to use

  1. Type a CSS color name; suggestions appear as you type, and spelling is checked against the official list.
  2. See the color and its HEX code, plus RGB, HSL and other notations in the All formats panel.
  3. Copy the code, or click a row in the reference table to load another common color.

Examples

A keyword with a story

rebeccapurple was added to CSS in 2014 in memory of Rebecca Meyer. Its value is #663399, which is also rgb(102, 51, 153).

Input
rebeccapurple
Output
#663399

When you need the code behind a name

CSS color keywords are friendly to read but awkward to reuse outside a browser. Converting them to HEX helps when you:

  • Move from a prototype to a design system. Early CSS often says color: tomato; the token file needs #ff6347.
  • Use the color in a tool that doesn’t know CSS names, such as Figma variables, Android XML, a PDF generator or a chart library.
  • Want a starting point for a custom color. Take steelblue, copy #4682b4, then make it slightly warmer or darker.

How the lookup works

Each of the 148 keywords maps to one fixed sRGB value defined in CSS Color Module Level 4. There is no rounding and no approximation: the result is the exact code a browser uses. The calculation panel shows the keyword’s channels and then writes each one as two hex digits, so rebeccapurple becomes 102 → 66, 51 → 33 and 153 → 99.

Surprising keywords

Some names do not mean what they suggest:

  • darkgray is lighter than gray. darkgray is #a9a9a9, gray is #808080.
  • green is not pure green. Use lime for #00ff00.
  • aqua and cyan, fuchsia and magenta are identical pairs.

The reference table under the converter lists common keywords with both codes, so you can compare them side by side.

Need the opposite? Use HEX to Color Name to find the closest keyword for any code. For RGB channel values, see Color Name to RGB.

Frequently asked questions

Why convert a name to HEX if browsers already understand the name?

Design tools, image editors, Android and iOS resources, email templates and many libraries accept only numeric colors. A HEX code also makes it easy to adjust the color slightly.

Is gray spelled gray or grey?

Both. CSS accepts the gray and grey spellings for every gray keyword, such as darkgray and darkgrey, and they have identical values.

Are the names case sensitive?

No. SteelBlue, steelblue and STEELBLUE all mean #4682b4. The converter accepts any capitalisation.

Why is the keyword green darker than lime?

CSS inherited its names from older X11 and HTML lists. green is #008000, while the pure #00ff00 is called lime. The preview helps avoid this classic surprise.

Can I enter a name in my own language?

No. CSS keywords are always the English names from the specification, whatever language the page is in.

Related tools