RGB to HEX
Convert Red, Green, and Blue channel values to standard CSS Hexadecimal color notation with real-time spectrum breakdowns.
RGB Channels Input
How to Convert RGB to HEX
Compute First Hex Digit
Take the decimal channel integer (0–255) and divide it by 16. The integer quotient (0–15) maps directly to the first hexadecimal character (0–9 or A–F).
Compute Second Hex Digit
Take the remainder of that division (value modulo 16). Map the remainder (0–15) to its corresponding hex character to complete the pair.
Assemble Final String
Prefix with a hash (#) and join the pairs RR + GG + BB in strict order. If using transparency, append the 2-digit alpha channel AA at the tail.
Related Developer Utilities
HEX to RGB
Deconstruct 3, 6, or 8 digit hex color codes back into distinct integer decimal channels and percentages.
Color Converter
Simultaneously translate between RGB, HEX, HSL, HSV, CMYK, and modern CSS OKLCH color spaces.
CSS Minifier
Compress and minify style sheets, purge duplicate selectors, and shorten color identifiers for production.
JS Minifier
Uglify and shrink frontend script files with dead-code elimination and variable mangling.
Convert RGB channels
Set red, green and blue from 0 to 255. Optional alpha adds opacity information to the result.
Example
Red 255, green 0 and blue 0 produce #ff 0000.
Before you use the result
Hex alpha support depends on the software where you paste the color.