image.cihat.dev

Color converter: HEX, RGB, HSL, OKLCH

Paste a colour in any format and get the same colour as HEX, RGB, HSL, HSB, OKLCH and CMYK, ready to copy.

Paste HEX, RGB, HSL, HWB, OKLCH, OKLab or a CSS name, with or without transparency. Three numbers such as 232 160 74 are read as RGB.

The same colour in every format
HEX
RGB
HSL
HSB / HSV
OKLCH
CMYK
Nearest CSS name

CMYK is the plain formula. For print, use the values your print shop’s colour profile gives.

How to use it

  1. Type or paste a colour code in the box, or open the colour picker beside it.
  2. Every format updates as you type. Codes with transparency, such as #E8A04A80 or rgb(232 160 74 / 50%), keep it.
  3. Press Copy next to the format your app needs.

How a HEX code becomes RGB

A HEX code is three pairs of base-16 digits: red, green and blue. Each pair runs from 00 to FF, which is 0 to 255. In #E8A04A, E8 is 14 × 16 + 8 = 232 red, A0 is 160 green and 4A is 74 blue, so the colour is rgb(232, 160, 74).

A fourth pair, as in #E8A04A80, is transparency: 80 is 128 of 255, about 50%. Three-digit codes double each digit, so #F80 is #FF8800.

Which format to use

All of these describe the same colour, #E8A04A. Pick the one your app asks for:

FormatExampleUsed in
HEX#E8A04ACSS, Figma, Canva, most design apps
RGBrgb(232, 160, 74)CSS, Photoshop, Office colour dialogs
HSLhsl(33, 77%, 60%)CSS, when you want to change lightness or saturation
HSB / HSV33°, 68%, 91%The colour pickers in Figma and Photoshop
OKLCHoklch(76.05% 0.1323 68.1)Modern CSS, design systems, palettes
CMYK0%, 31%, 68%, 9%Print, as a starting point

What OKLCH is for

OKLCH describes a colour by lightness, chroma (how colourful it is) and hue. Unlike HSL, the same lightness looks equally light across hues, so palettes and hover states can be built by changing one number. Every current major browser supports oklch() in CSS.

OKLCH can also describe colours outside sRGB, the range every screen shows. When you enter one, this page says so: HEX, RGB, HSL, HSB and CMYK then give the nearest colour inside sRGB.

CMYK values are an estimate

Screens mix light; printers mix ink. The CMYK shown here comes from the simple formula most converters use. Real print conversion depends on the paper, the ink and the printer’s colour profile, so two print shops can need different CMYK values for the same colour. Ask your printer, or convert in your design app with their profile.

Questions people ask

How do I convert HEX to RGB?

Paste the HEX code, with or without the #, and copy the RGB line. #FF5733 becomes rgb(255, 87, 51).

How do I convert RGB to HEX?

Type the three numbers, such as 255 87 51 or rgb(255, 87, 51), and copy the HEX line: #FF5733.

Is HSB the same as HSV?

Yes. HSB (hue, saturation, brightness) and HSV (hue, saturation, value) are two names for one model, the one Figma and Photoshop pickers use. It is not the same as HSL.

Can I convert a colour with transparency?

Yes. Use an eight-digit HEX code such as #FF573380, rgba(), or the slash form rgb(255 87 51 / 50%). HEX, RGB, HSL and OKLCH keep the transparency.

Is anything sent to a server?

No. The conversion runs in your browser.