Nothing uploaded
Convert HEX to RGB
Type a hex color code to get its rgb() value, ready for CSS, along with every other format. Codes with 3, 4, 6 or 8 digits work, with or without the #.
HEX, rgb(), hsl(), hsv(), cmyk(), oklch() or a CSS name such as tomato.
Contrast
On white 2.95:1
- AA, normal text: Fail
- AA, large text: Fail
- AAA, normal text: Fail
- AAA, large text: Fail
On black 7.13:1
- AA, normal text: Pass
- AA, large text: Pass
- AAA, normal text: Pass
- AAA, large text: Pass
For text in this color on a white or black background (WCAG 2). Large text is 24 px, or 18.66 px bold.
Formats
Read as HEX.
- RGB
- rgb(255, 99, 71)
- HEX
- #ff6347
- HSL
- hsl(9.1, 100%, 63.9%)
- HSV (HSB)
- hsv(9.1, 72.2%, 100%)
- CMYK (approximate)
- cmyk(0%, 61.2%, 72.2%, 0%)
- OKLCH
- oklch(69.62% 0.1955 32.32)
- CSS name
- tomato
CMYK uses the simple formula, without a color profile. Printers convert with their own profile, so treat it as a starting point.
What you type stays on this device. Nothing is uploaded.
Did this save you time? DigiTools is free, with no ads and no sign-up. Leave a tip (opens in a new tab) to help keep it that way.
Tell others what you think: review DigiTools on Trustpilot (opens in a new tab).
How to convert HEX to RGB
- Type or paste a hex code, such as #ff6347.
- Read the RGB value at the top, with every other format under it. It updates as you type.
- Copy what you need, and check how readable the color is on white and on black.
Questions
Is anything sent to a server?
No. Colors are converted in your browser on this device, as you type, and nothing is stored.
How do I convert HEX to RGB by hand?
Split the code into three pairs and turn each from hexadecimal into a number: multiply the first digit by 16 and add the second, with a to f standing for 10 to 15. In #ff6347, ff is 15 × 16 + 15 = 255, 63 is 6 × 16 + 3 = 99 and 47 is 71, so it’s rgb(255, 99, 71).
What about 3-digit and 8-digit codes?
A 3-digit code doubles each digit: #f63 is #ff6633. An 8-digit code adds the opacity at the end, from 00 to ff: #ff634780 becomes rgba(255, 99, 71, 0.502), about half transparent.