Hex to RGB converter
Type a hex code to get its RGB values, or set red, green and blue to get the hex code. The preview updates as you type. Everything runs in your browser.
#004487 equals rgb(0, 68, 135).
#004487rgb(0, 68, 135)
White text has a 9.6:1 contrast ratio, which passes for body text.
Copy in any format
Each value is ready to paste into your CSS.
| Format | Value | Actions |
|---|---|---|
| Hex | #004487 | |
| Hex, lowercase | #004487 | |
| RGB | rgb(0, 68, 135) | |
| HSL | hsl(210, 100%, 26%) | |
| CSS variable | --color: #004487; |
Common colors
Select a color to load it into the converter.
How it works
1
Enter a color
Type a hex code, or set the red, green and blue values.
2
Check the preview
The swatch shows the color and how readable white or black text is on it.
3
Copy the format
Copy the hex, rgb() or hsl() value and paste it into your styles.