A HEX colour code such as #FFA500 is just three two-digit hexadecimal numbers: FF red, A5 green and 00 blue. Converting them to decimal gives the RGB values 255, 165, 0 used in CSS rgb() and design apps.
How to use the HEX to RGB Converter
- Input format
- Colour
Everything runs in your browser, so results appear instantly and nothing you type is sent to a server.
How it works
Your colour is parsed in the format you choose and converted to RGB first; every other notation is computed from RGB. CMYK here is a simple device-independent conversion; professional printing uses colour profiles that can shift the values.
Formula
HEX: each pair of hex digits = one RGB channel (00–FF = 0–255)HSL/HSV from RGB via the standard hexcone formulasCMYK: K = 1 − max(R,G,B)/255Worked example
Inputs — Input format: HEX (#RRGGBB); Colour: #FFA500.
Results — HEX = #FFA500; RGB = rgb(255, 165, 0); HSL = hsl(39, 100%, 50%); HSV / HSB = hsv(39, 100%, 100%); CMYK = cmyk(0%, 35%, 100%, 0%); Decimal value = 16,753,920.
Key terms
- HEX code
- A colour written as #RRGGBB in hexadecimal.
- Contrast ratio
- WCAG measure of luminance difference between text and background, from 1:1 to 21:1.
Frequently asked questions
How do I convert HEX to RGB?
Split the code into three pairs and convert each from base 16 to base 10: FF = 255.
What contrast ratio do I need for text?
WCAG asks for at least 4.5:1 for normal text and 3:1 for large text.
Can I enter a 3-digit HEX code?
Yes: #F80 is read as #FF8800.
What formula does the HEX to RGB Converter use?
HEX: each pair of hex digits = one RGB channel (00–FF = 0–255).