HEX to RGB Code Converter
Convert hex color codes (#RRGGBB) to decimal integer rgb(r, g, b) tuples instantly with channel breakdowns.
Technical Specification & Mathematical Principles
Hexadecimal numbers use base-16 digits 0-9 and A-F (where A=10, B=11, C=12, D=13, E=14, F=15). A 6-character hex string decomposes into three 8-bit channel byte pairs: #RRGGBB.
Worked Example: #3366CC
Red: 33₁₆ = (3 × 16) + 3 = 48 + 3 = 51
Green: 66₁₆ = (6 × 16) + 6 = 96 + 6 = 102
Blue: CC₁₆ = (12 × 16) + 12 = 192 + 12 = 204
Output: rgb(51, 102, 204)
3-Digit Shorthand Example: #F0A
CSS shorthand duplicates each character: #F0A → #FF00AA
FF₁₆ = 255, 00₁₆ = 0, AA₁₆ = 170
Output: rgb(255, 0, 170)
Input parsing accepts both standard # prefixes and bare hex strings, with automatic sanitization of whitespace.
Frequently Asked Questions
How does the base-16 to base-10 conversion work?
Does this converter support 3-digit shorthand hex codes?
What is the difference between integer and normalized RGB?
Related Design & Color Instruments
RGB to HEX Converter
Convert decimal RGB integer components (0-255) to uppercase 6-digit padded hexadecimal strings.
HEX to HSL Converter
Convert hexadecimal color codes to CSS HSL and HSLA cylindrical coordinates with step-by-step algebraic formula breakdowns.
HSL to HEX Converter
Transform cylindrical HSL coordinates into standardized 6-digit hexadecimal web color strings.
Pantone to HEX Matcher
Instant Pantone (PMS) to HEX, RGB, and CMYK color converter. Find the closest hexadecimal code and reverse-match HEX to PMS using CIE Delta E math.