Color Picker and Color Code Converter
Pick a color and copy its HEX, RGB, HSL, HSV, CMYK or OKLCH code, then check text contrast.
- HEX
- #1d4ed8
- RGB
- rgb(29, 78, 216)
- HSL
- hsl(224, 76%, 48%)
- HSV / HSB
- hsv(224, 87%, 85%)
- CMYKSimple formula, not a print profile
- cmyk(87%, 64%, 0%, 15%)
- OKLCH
- oklch(48.8% 0.217 264.4)
Tints (lighter)
Shades (darker)
Matching colors
- Complementary
- Analogous
- Analogous
Recent colors
Colors you pick are kept here, in this browser only.
How to use
- Pick a color with the color box, or type or paste a code into the field next to it. HEX, rgb(), hsl() and names like navy all work.
- Read the same color as HEX, RGB, HSL, HSV, CMYK and OKLCH, and press Copy next to the format you need.
- In the contrast checker, choose a background color to see the contrast ratio and whether the text passes WCAG AA and AAA.
- Click any tint, shade or matching color to make it the main color, or click its code to copy it.
What HEX, RGB and HSL actually mean
Every color on a screen is a mix of red, green and blue light. RGB writes that mix directly: rgb(29, 78, 216) means a little red, some green and a lot of blue, each channel from 0 to 255. HEX is the same three numbers in base 16, so 29, 78 and 216 become 1d, 4e and d8, giving #1d4ed8. A short code like #777 is shorthand for #777777, and an eight-digit code adds a fourth pair for opacity.
HSL describes the same color in a way that is easier to adjust by hand: hue as an angle on the color wheel (0 is red, 120 green, 240 blue), saturation as how vivid it is, and lightness from black to white. hsl(224, 76%, 48%) is the same blue as above. HSV, which Photoshop and many design apps call HSB, uses value (brightness) instead of lightness, so a pure color sits at 100% rather than 50%.
OKLCH is the newest format in CSS. Its lightness is measured the way the eye perceives it, so two colors with the same OKLCH lightness actually look equally bright, which is not true of HSL. It is useful for design systems, where you want a whole palette to step evenly from light to dark.
Which format to use where
- HEX for CSS, design tools and brand guides. It is short and almost every app accepts it.
- RGB or rgba() when you need transparency in older code, or when a program asks for three numbers.
- HSL when you want to nudge a color by hand: raise lightness for a hover state, lower saturation for a muted variant.
- HSV/HSB to match the numbers shown in Photoshop, Figma’s picker or similar editors.
- OKLCH for modern CSS palettes and themes.
- CMYK only as a rough guide for print, as explained below.
Why screen and print colors differ
Screens add light, so red, green and blue at full strength make white. Printers subtract light with cyan, magenta, yellow and black (key) ink on paper, which starts out white. Many bright screen colors, especially saturated blues and greens, simply cannot be printed. The CMYK figures here come from a basic formula with no knowledge of your paper or press, so a print shop working with a real color profile may use different numbers. For important print jobs, ask for a proof.
Contrast and accessibility basics
Text that is too close in brightness to its background is hard to read, especially on a phone in sunlight or for people with low vision. The Web Content Accessibility Guidelines (WCAG) measure this as a contrast ratio between 1:1 (no difference) and 21:1 (black on white). Gray #777777 on white is 4.47:1, just short of the 4.5:1 that level AA requires for body text, though it passes for large headings. The checker never rounds up, so a result that reads 4.49 fails. Color alone should never carry meaning, so pair red and green status colors with words or icons as well.
Tints, shades and matching colors
Tints mix the color with white and shades mix it with black in even steps, which gives quick hover, border and background variants. The complementary color sits opposite on the color wheel and stands out strongly; analogous colors sit 30° to either side and feel calm together. To check how a color looks filling your whole display, try the white screen tool with a custom color. If you are preparing images for a site that uses these colors, the image compressor keeps file sizes down.
Frequently asked questions
How do I convert HEX to RGB?
Type or paste the HEX code, for example
Why is the CMYK value different from what my printer or designer uses?
The CMYK shown here comes from a simple formula that ignores paper, ink and print profiles. Real print conversion uses an ICC profile such as FOGRA39 or GRACoL, which can give quite different numbers. Use it as a starting point and ask your print shop for the final values.
What does the alpha value in an 8-digit HEX code mean?
The last two digits are opacity.
What contrast ratio do I need for text?
WCAG 2 level AA asks for at least 4.5:1 for normal text and 3:1 for large text. Level AAA asks for 7:1 and 4.5:1. Large means at least 24px, or about 18.66px when bold.
Why don't I see the "Pick a color from the screen" button?
Picking a color from anywhere on the screen uses the EyeDropper feature, which only Chrome, Edge and other Chromium browsers support so far. In Safari and Firefox the button is hidden, but the color box and the code field work everywhere.
Are my colors saved or sent anywhere?
No. Everything runs in your browser. The list of recent colors is stored only in this browser's local storage, and Clear removes it.
What is OKLCH and should I use it?
OKLCH is a newer CSS color format based on how bright and colorful a color looks to people. Changing only its lightness keeps the hue steady, which makes it handy for building color scales. All current major browsers support it.
Related tools
- Image Compressor and ResizerShrink photos and images in bulk, resize them and convert to JPG, PNG or WebP — without uploading.
- HEIC to JPG ConverterTurn iPhone HEIC photos into JPG or PNG files right in your browser, many at a time.
- White ScreenFill your display with plain white or any color, and adjust the brightness.
- Dead Pixel TestFill your screen with solid colors to spot dead, stuck and hot pixels in seconds.
- QR Code GeneratorMake static QR codes for links, Wi-Fi, contacts and more. No sign-up, no expiry, no tracking.