CSS color name to HEX

Case and spaces do not matter, so Light Sea Green and lightseagreen give the same result.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Enter color name.
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

A direct lookup in the named color list defined in CSS Color Module Level 4, where each name has a fixed sRGB value.

Example

Inputs: Color name = rebeccapurple. Result: HEX code: #663399.

rebeccapurple
#663399

Limits and caveats

  • Keywords like transparent and currentColor are not named colors and are not accepted.
  • Old X11 values that differ from CSS (such as a lighter gray) are not used here.

Questions about this tool

How many color names does CSS have?

148, including aliases for the same color such as gray and grey, aqua and cyan, fuchsia and magenta.

What is the story of rebeccapurple?

It was added to CSS in 2014 in memory of Eric Meyer's daughter, and its value is #663399.

Why is darkgray lighter than gray?

The values were inherited from the old X11 list: darkgray is #A9A9A9 while gray is #808080.