HomeAll ToolsCategoriesDeveloper ToolsAboutContact
Code / Developer tools

HEX to RGB

Convert hexadecimal color codes (3, 6, or 8 characters) into RGB and RGBA integer values.

palette
code CSS Color Module L4
EXAMPLE
#
colorize
Format Selector
100% (255 / 1.00)
0% 100%
Preset Swatches Click to load
Bitwise Conversion Matrix
Red Bit Pair 0x1D (1 × 16) + 13 = 29
Green Bit Pair 0x4E (4 × 16) + 14 = 78
Blue Bit Pair 0xD8 (13 × 16) + 8 = 216
LIVE PREVIEW contrast Contrast: High
rgb(29, 78, 216) rgba(29, 78, 216, 1)
Channel Breakdown 8-bit [0-255]
Red (R)
Hex: 1D 29
Green (G)
Hex: 4E 78
Blue (B)
Hex: D8 216
Alpha (A)
Dec: 255 1.00
CSS Syntax Snippets
RGB Statement rgb(29, 78, 216);
RGBA Statement rgba(29, 78, 216, 1);

How to Convert HEX to RGB

Understand the base-16 mathematical transformation that powers hex-to-color mapping in web browsers.

01 call_split

Split Hex Pairs

A 6-digit hex color format is made of three distinct pairs: #RR GG BB. If starting from a shorthand 3-digit hex (#RGB), each digit is doubled (#1D8 becomes #11DD88).

02 calculate

Convert Base-16 to Base-10

Multiply the first hex character by 16 and add the value of the second digit. Hex digits A-F correspond directly to 10-15. For example: 1D = (1×16) + 13 = 29.

03 join_inner

Assemble RGB Triplet

Take each resulting decimal integer (bounded between 0 and 255) and assemble into standard CSS syntax: rgb(29, 78, 216) or append alpha for transparent RGBA layers.

HOW TO USE

Convert a hex color

Enter a supported hex color and copy its RGB representation. Enable alpha when an opacity value is needed.

Example

#ff 0000 represents rgb(255, 0, 0).

Before you use the result

Color appearance can vary by screen and color profile; numeric conversion is not a print-color match.