About the HTML Color Codes tool
Every colour on a web page is written as a code: a hex value like #4F46E5, an rgb() or hsl() function, or one of the named colours such as tomato or steelblue. This page brings all of them together: a colour picker that gives you every format at once, and a complete, searchable list of CSS named colours.
Pick a colour with the native picker, type a hex code or paste any CSS colour such as rgb(34 197 94) or hsl(200 80% 50%). You instantly get the HEX, RGB and HSL codes with copy buttons, the closest named colour, a strip of lighter tints and darker shades you can click to explore, and the contrast ratio against white and black text so you can judge readability against the WCAG 4.5:1 guideline.
Below the picker, the table lists 141 CSS named colours, with the grey spellings folded into the gray names since both work. Search by name or hex, filter by family such as reds, blues or browns, and sort alphabetically, by hue or by lightness. Click any name, HEX or RGB value to copy it, or click a swatch to load it into the picker.
How to use HTML Color Codes
- Choose a colour in “Pick a colour or type a HEX code”, or paste any CSS colour into the field below.
- Copy the HEX, RGB, HSL or nearest name from the “Colour codes” list.
- Click a tint or shade to explore lighter and darker versions.
- Search or filter the “CSS named colours” table and click values to copy them.
Features
All formats at once
HEX, RGB, HSL and the nearest CSS colour name update together.
Complete named colour list
Every CSS named colour with HEX, RGB and HSL values.
Search, filter and sort
Find colours by name or hex, by family, or ordered by hue or lightness.
Tints, shades and contrast
See lighter and darker variations and contrast ratios with white and black.
One-click copy
Copy any code from the picker or the table instantly.
When to use it
- Find the hex code of a named colour like coral or slategray.
- Convert a brand colour between HEX, RGB and HSL for CSS.
- Pick readable text colours by checking contrast ratios.
- Browse colour families for inspiration when designing a page.
- Look up the exact colour a CSS keyword produces.
Frequently asked questions
How many HTML colour names are there?
CSS defines 148 named colours, but several are duplicates: aqua/cyan and fuchsia/magenta share values, and seven gray colours can also be spelled grey. This list shows 141 entries.
What is the difference between HEX and RGB?
They describe the same red, green and blue values. HEX writes each channel as two hexadecimal digits (#FF6347), while RGB uses decimal numbers from 0 to 255 (rgb(255, 99, 71)).
When should I use HSL?
HSL (hue, saturation, lightness) makes it easy to create lighter, darker or less saturated versions of a colour by changing one number.
Are named colours safe to use in all browsers?
Yes. All 148 CSS named colours are supported by every modern browser and email client that supports CSS colours.
What contrast ratio do I need?
WCAG AA asks for at least 4.5:1 between normal text and its background, and 3:1 for large text.