Guide
HEX, RGB, HSL, OKLCH and CMYK - which color format to use where
The same orange can be written as #FF6600, rgb(255 102 0), hsl(24 100% 50%) or oklch(69.6% 0.204 43.5). Design tools, CSS, brand guidelines and printers each prefer a different notation, so moving a color between them is a daily task. Paste a color in any common format and this converter gives you all the others, plus a matching shade scale and a contrast check.
Converting a color
Type or paste a color into the box, or use the picker. Accepted inputs:
- HEX: #f60 or #ff6600 (the # is optional)
- RGB: rgb(255 102 0) or rgb(255, 102, 0)
- HSL / HSV: hsl(24 100% 50%), hsv(24 100% 100%)
- OKLCH: oklch(69.6% 0.204 43.5)
- Names: any CSS color name, such as tomato, teal or rebeccapurple
All six output formats update instantly and can be copied individually.
Which format belongs where
| Format | What it describes | Typical use |
|---|---|---|
| HEX | Red, green, blue as hex pairs | CSS, brand guides, design handoff |
| RGB | Red, green, blue from 0 to 255 | CSS, image editors, code |
| HSL | Hue, saturation, lightness | Quick manual tweaks in CSS |
| HSV / HSB | Hue, saturation, brightness | Color pickers in Photoshop and Figma |
| OKLCH | Perceptual lightness, chroma, hue | Modern CSS, design systems, shades |
| CMYK | Cyan, magenta, yellow, black ink | A starting point for print |
HSL vs OKLCH: HSL is easy to read but not perceptual. Yellow and blue at the same HSL lightness look very different in brightness. OKLCH fixes that, so equal lightness values actually look equally light, which is why newer design systems build their palettes in it.
Tints and shades
The 50–950 scale works like the palettes in Tailwind CSS: 50 is nearly white, 500 is close to the base, 950 is very dark. It’s built in OKLCH, so the hue stays consistent and the steps look even. Typical uses:
- 50–100: page and card backgrounds
- 200–300: borders and disabled states
- 500–600: buttons and links
- 700–900: text and hover states
Click any chip to load that color and convert it, for example to get its RGB value.
Contrast at a glance
The contrast panel shows your color as text on white and on black, with the WCAG ratio and level:
- AAA: 7:1 or more
- AA: 4.5:1 or more, the usual minimum for body text
- AA large only: 3:1 or more, acceptable for large or bold headings
- Fails: below 3:1
For example, #FF6600 manages only 2.94:1 on white, so orange text on white needs to be darker. For any text and background pair, and a suggested fix, use the Contrast Checker.
A word about CMYK
Screens mix light (RGB); printers mix ink (CMYK). The CMYK values here are a straightforward mathematical conversion without a color profile, so they’re a reasonable estimate, not a print specification. Bright screen colors such as vivid orange or electric blue often can’t be printed exactly. For brand printing, use your printer’s profile or a Pantone guide.
Copy as a CSS variable
Copy as CSS variable gives --color: #ff6600;. Paste it into :root { } and rename it (for example --brand) to reuse the color across a stylesheet.
Who converts colors
- Web developers move colors from design files into CSS in hex, rgb() or oklch().
- Designers match brand colors across Figma, Photoshop, PowerPoint and Canva, which ask for different formats.
- Marketers give printers and agencies brand colors in the format they ask for.
- Students learn how color models relate in design and computing classes.
A complete example: a brand color for a website
A logo uses the color #2563EB:
- Paste it to get rgb(37 99 235), HSL and OKLCH.
- Use the 50–950 scale: 50 or 100 for light backgrounds, 600 for buttons, 800 for hover states.
- Check the contrast panel: #2563EB reaches about 5.2:1 on white, enough for normal text links.
- Copy the CSS variable and define your palette in one place in the stylesheet.
Tips
- Keep one source of truth, such as a brand guide, so colors don’t drift between tools.
- Ask printers for their CMYK values or profile instead of relying on screen conversions.
Related tools
- Color Palette Generator for harmonious color schemes.
- Contrast Checker for accessible text colors.
- Image Color Picker to take a color from a photo or logo.
- CSS Gradient Generator to blend colors.
Checked against the current version of the Color Picker on .

