GamutDesk Logo
GamutDesk

HEX to RGB Code Converter

Convert hex color codes (#RRGGBB) to decimal integer rgb(r, g, b) tuples instantly with channel breakdowns.

Client-Side ArchitecturePrivate Client-Side Processing
#2563EB
CSS RGB String
rgb(37, 99, 235)
Normalized Float (0.0 - 1.0)
rgb(0.145, 0.388, 0.922)
Red (R)
37
0x25
Green (G)
99
0x63
Blue (B)
235
0xEB

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?
Each pair of hexadecimal digits corresponds to an 8-bit byte (00 to FF). The first digit is multiplied by 16 and added to the second digit: Red = (16 * first) + second.
Does this converter support 3-digit shorthand hex codes?
Yes. 3-character hex strings like #FFF are automatically expanded to 6-character equivalents (#FFFFFF) by duplicating each channel character.
What is the difference between integer and normalized RGB?
Standard digital displays use integer ranges (0-255). Modern WebGL shaders and GPU graphics pipelines frequently require normalized floating-point ranges between 0.000 and 1.000.

Related Design & Color Instruments