RGB to Hex
Convert RGB to Hex Colors
Runs in your browser Your input never leaves your device.
| HEX | — | |
| RGB | — | |
| HSL | — |
About this tool
Converts an RGB color to a hex code and shows the same color as HEX, RGB and HSL together with a live swatch. Type a value such as rgb(76, 63, 242) or just 76, 63, 242, or choose a color with the picker. Hex and hsl() values are accepted too, so you can convert in either direction. Each channel is limited to 0-255, with higher numbers set to 255. A fourth alpha value in rgba() is ignored, and the hex output is always six digits without transparency. Each result has a copy button. Conversion is done in your browser.
How to use it
- Enter RGB values, for example rgb(76, 63, 242), or pick a color.
- Read the hex code in the HEX row.
- Press copy to use it in your CSS.
Example
rgb(76, 63, 242)
#4c3ff2
Common problems
- Nothing changes after typing
- The input is not recognized. Use three numbers from 0 to 255, such as 76, 63, 242.
- Transparency is lost
- The alpha value in rgba() is ignored and hex output has no alpha digits.
- A number above 255 is changed
- Channels are capped at 255, so 300 becomes 255.