Convert RGB colors to HEX and back in one click
RGB Input
HEX Output
Quick Presets
HEX Format Reference
6-digit HEX
#RRGGBB
Each pair is 00–FF (0–255 decimal)
3-digit shorthand
#RGB
Doubles each digit: #F60 = #FF6600
RGB range
Each channel: 0 (none) to 255 (full)
HEX base
Base-16: 0–9 then A–F (10–15)
The RGB to HEX converter lets you instantly translate RGB color values (red, green, blue channels from 0–255) into six-digit hexadecimal color codes used in CSS, HTML, and design tools — and convert HEX back to RGB just as fast. Use the interactive sliders or paste any HEX code to get copy-ready CSS output without any math or guesswork.
Each RGB channel (0–255) maps to a two-digit hexadecimal pair. Red becomes the first pair, green the second, and blue the third. For example, rgb(99, 102, 241) converts to #6366F1. Our tool handles the math automatically — just enter or slide your R, G, B values.
A 3-digit HEX (#RGB) is shorthand where each digit is doubled: #F60 expands to #FF6600. It only works when both digits in every channel are identical. The full 6-digit form (#RRGGBB) works for all 16 million colors.
Yes. The tool outputs both the HEX code (#RRGGBB), the classic CSS rgb() function, and the modern space-separated rgb() syntax, all with one-click copy buttons. It also outputs a GLSL vec3() float representation for shader work.
A valid HEX color starts with # followed by either 3 or 6 hexadecimal characters (0–9 and A–F). Examples: #F00 (shorthand red), #FF0000 (full red), #6366F1 (indigo). Letters are case-insensitive.