RGB to HEX converter

Type three numbers like 255, 99, 71 or rgb(255 99 71) to get the hex code #ff6347.

HEX
RGB
HSL
HSV
CMYK
LAB

RGB to HEX formula

Convert each channel (0–255) to two hex digits and join them: 255 → FF, 99 → 63, 71 → 47 → #FF6347. Values under 16 need a leading zero (10 → 0A).

Decimal to hex for channel values

DecimalHex
000
1711
3422
5133
6440
8555
10266
12880
15399
170AA
192C0
204CC
221DD
238EE
255FF

Frequently asked questions

Can RGB values be over 255?
No. Each channel is one byte, 0–255. Higher values are clamped to 255.
Does CSS accept rgb with percentages?
Yes: rgb(100% 50% 0%) is the same as #ff8000.