HEX Colors & Color Codes
Search 148 CSS color names or enter any HEX code in the color picker, compare formats and contrast, and copy useful tints, shades and CSS values.
HEX color inspector
Enter a color code
Use three or six hexadecimal digits. The preview, nearest CSS name, formats, variations, luminance, and contrast update together.
Nearest CSS named color
steelblue · #4682B4
Tints and shades
tints
shades
Luminance and contrast
Relative luminance: 0.1780
Ready to inspect a HEX color.
CSS color reference
Search named HTML colors
These standardized CSS color keywords map to fixed sRGB values. Select any swatch to inspect and copy its HEX code.
148 matching colors

Quick answer
A HEX color code represents red, green, and blue with hexadecimal pairs from 00 to FF. For example, #1478C9 means red 20, green 120, and blue 201. CSS accepts full six-digit codes and shorthand three-digit codes when each pair repeats.
Quick guide
How to find and use HEX color codes
Use the inspector for an exact value or search the standardized CSS color-name chart. Every selected color can be copied, converted, compared for contrast, and expanded into lighter or darker variations.
- 1
Enter or search
Type a three- or six-digit HEX code, use the native picker, or search a standardized CSS color name or value.
- 2
Inspect the color
Review RGB, HSL, OKLCH, the closest CSS name, relative luminance, and text contrast against white and black.
- 3
Copy what you need
Copy the HEX code, another color format, a CSS variable, or a generated tint or shade.
Practical uses
HTML and CSS
Look up a color keyword or paste a HEX value before using it in a property, variable, or design token.
Brand documentation
Confirm the numeric value behind a swatch and compare it with a familiar CSS color name.
Interface states
Start from one base value and explore lighter or darker candidates for surfaces, borders, hover states, and accents.
Method and accuracy
How this tool works
Each HEX pair is converted from base 16 to an sRGB channel from 0 to 255. HSL is calculated from normalized sRGB channels, OKLCH is derived through linear sRGB and OKLab, and relative luminance follows the WCAG sRGB transfer function. The nearest name is selected by distance in perceptual OKLab coordinates rather than raw RGB distance.
Frequently asked questions
How many colors can six-digit HEX represent?
Six hexadecimal digits provide 256 values for each of three channels, producing 16,777,216 possible RGB combinations.
What does three-digit shorthand mean?
#39F expands to #3399FF. Shorthand is valid only when both digits in each full channel pair are identical.
Are CSS named colors more accurate than HEX?
No. A CSS keyword maps to a specific sRGB value, usually written as HEX. The keyword is simply a readable alias.