Home / HEX to RGB Converter

HEX to RGB Converter

Type or pick a color and get its HEX, RGB, HSL and CMYK values at once. Edit any field and the others update.

How to convert HEX to RGB

A HEX color such as #267FD9 is three pairs of hexadecimal digits: red, green and blue. Convert each pair to a decimal number from 0 to 255:

26 = 2×16 + 6 = 38 · 7F = 7×16 + 15 = 127 · D9 = 13×16 + 9 = 217
So #267FD9 = rgb(38, 127, 217)

To go from RGB to HEX, convert each number to two hex digits (38 → 26, 127 → 7F, 217 → D9) and join them. The converter above does both directions, and it also accepts three-digit shorthand: #26D is the same as #2266DD.

Color formats compared

FormatExample (same color)Best for
HEX#267FD9CSS, design tools, short and easy to copy
RGBrgb(38, 127, 217)Screens, code that blends or animates channels
HSLhsl(210, 70%, 50%)Making lighter or darker shades by changing lightness
CMYKcmyk(82%, 41%, 0%, 15%)Print, approximate only

A note on CMYK

CMYK values here use the standard mathematical conversion from RGB. Real print colors depend on the printer, paper and color profile, so use the result as a starting point and check a proof before printing.

Related guide

Want palettes from your color? Read the guide to monochromatic and complementary colors or generate one in the color palette generator.

Frequently asked questions

How do I convert HEX to RGB?

Split the HEX code into three pairs and convert each from hexadecimal to decimal. #FF8000 is FF=255, 80=128, 00=0, so rgb(255, 128, 0).

What is the RGB value of #FFFFFF?

rgb(255, 255, 255), which is white. #000000 is rgb(0, 0, 0), which is black.

Does it support 3-digit HEX codes?

Yes. A three-digit code is expanded by doubling each digit, so #F80 becomes #FF8800.

Why is the CMYK value only approximate?

CMYK depends on the printer and paper. The tool uses the standard formula from RGB, so real print results can look different.

Is my data sent anywhere?

No. All conversion runs in your browser.

Share this page
XFacebookLinkedInWhatsAppTelegram