CSS Color Name to Hex
Convert a standard CSS named color like cornflowerblue into its 6-digit hex code — an exact lookup across all 147 CSS Color Module names.
How CSS Color Name to Hex Conversion Works
The CSS Color Module spec defines a fixed hex value for each of its roughly 147 named colors. This tool looks up your color name — case-insensitively — against that list and returns the exact 6-digit hex code, the same value every standards-compliant browser renders for that name.
CSS Color Name to Hex Example, Step by Step
cornflowerblue = #6495ED
cornflowerblue (CSS color name) = #6495ED (hex)
Name input: cornflowerblue Look up against the 147 CSS Color Module names Fixed hex value: #6495ED
| Step | Description | Result |
|---|---|---|
| Take the color name | cornflowerblue | cornflowerblue |
| Normalize case | lowercase for lookup | cornflowerblue |
| Look up in the CSS spec table | find the defined hex value | #6495ED |
| Return the hex code | always 6 digits | #6495ED |
Unlike the reverse direction, every valid CSS color name has exactly one defined hex value — there's no ambiguity to resolve here.
Common Mistakes With CSS Color Name to Hex
- Typing a non-standard name like "skyblue2" or a design tool's custom label, which isn't part of the CSS spec.
- Assuming British and American spellings both work for every color — grey and gray are both valid, but that's an exception, not the rule.
- Confusing a CSS color name with a Tailwind or Bootstrap palette name — those are separate naming systems with different hex values.
Frequently Asked Questions
What CSS color names does this tool support?
All roughly 147 standard names from the CSS Color Module spec, from common ones like red and blue to less familiar entries like cornflowerblue and rebeccapurple.
What's the hex code for cornflowerblue?
#6495ED — a fixed value defined by the CSS Color Module spec, the same in every standards-compliant browser.
Are CSS color names case-sensitive?
No — CornflowerBlue, cornflowerblue, and CORNFLOWERBLUE all resolve to the same hex code, both in browsers and in this tool.
What happens if I enter a color name that doesn't exist?
The tool returns an error, since only the standard CSS Color Module names have a defined hex value to look up.
What's the hex code for rebeccapurple?
#663399 — a named color added to the CSS spec in 2014 in memory of Rebecca Meyer, Eric Meyer's daughter.