Hex to RGB converter
Turn any hex color code into its RGB value, with the matching HSL, OKLCH, CMYK and Tailwind values ready to use in your CSS.
3, 4, 6 or 8 digits. The # is optional.
RGB
White text3.22:1Fails AA
Black text6.52:1Passes AA
Other formats
Copy every format and code snippet in one click.
Free and open source
Got your color?Put it to work in your next design.
Agent-Native Design turns a prompt into ads, pages, brand assets and prototypes, all in your colors.
Hex to RGB in JavaScript and Python
Common colors in hex and RGB
| Color | Hex | RGB |
|---|---|---|
| White | #FFFFFF | 255, 255, 255 |
| Black | #000000 | 0, 0, 0 |
| Red | #FF0000 | 255, 0, 0 |
| Green | #00FF00 | 0, 255, 0 |
| Blue | #0000FF | 0, 0, 255 |
| Yellow | #FFFF00 | 255, 255, 0 |
| Cyan | #00FFFF | 0, 255, 255 |
| Magenta | #FF00FF | 255, 0, 255 |
| Gray | #808080 | 128, 128, 128 |
| Orange | #FFA500 | 255, 165, 0 |
FAQs
Get answers to common questions
Paste the hex code into the converter and copy the RGB values. To convert by hand, split the code into three pairs. Then convert each pair from base 16 to base 10. #E2649A splits into E2, 64 and 9A. In base 10 that's rgb(226, 100, 154).
They describe the same colors in two notations. RGB writes red, green and blue as numbers from 0 to 255. Hex writes the same numbers in base 16. #FF0000 and rgb(255, 0, 0) are the same red.
Use an 8-digit hex code. The last pair sets the opacity. #E2649A80 converts to rgba(226, 100, 154, 0.502). 80 in hex is 128, and 128 of 255 is about 50%.
Unity, Swift and shader code use decimals from 0 to 1 instead of 0 to 255. Divide each value by 255. 226 becomes 0.886. The converter shows both.
It's shorthand. Each digit is doubled. #E69 is the same as #EE6699. A 4-digit code like #E698 also sets the opacity.
It's another name for a hex to RGB converter. It reads a hex color code and shows the same color in other formats.