Text & code / MULTIVERTO

HEX to RGB color

Convert a #RGB or #RRGGBB color into three RGB channel values.

Live converterYour input stays in this browser. No text is uploaded for conversion.
The file stays in your browser.
Chain tools

Apply each text tool to the previous result.

01 / Guide

How it works

Each two-digit hex pair becomes one red, green or blue channel from 0 to 255; shorthand digits are doubled.

Good to know

The result has no alpha channel; this tool uses integer RGB and conventional HSL, not color-management profiles.

02 / Example

Example

Your input#2A7FDC
Resultrgb(42, 127, 220)

03 / Guide

HEX to RGB color — How it works

From a hex swatch to channels

Convert a #RGB or #RRGGBB color into three RGB channel values. Use this direction when a design token or CSS rule gives a hex code but a graphics control asks for separate red, green and blue integers. The optional # is notation, not part of the numeric value. Three-digit shorthand is expanded before conversion, so #ABC means #AABBCC rather than three tiny channel values.

Each two-digit hex pair becomes one red, green or blue channel from 0 to 255; shorthand digits are doubled. For #2A7FDC, the pairs 2A, 7F and DC become 42, 127 and 220 in decimal. Enter only three or six hex digits; four- and eight-digit codes include alpha and are intentionally rejected here. The output is an rgb() expression ready for CSS or for reading individual channels. For a concrete check, the example input #2A7FDC produces rgb(42, 127, 220). Keep the original beside the result when comparing it with another application.

Understanding the color models

HEX and RGB describe the same three additive light channels. Each channel has an integer value from zero to 255, and hexadecimal writes that value with two base-sixteen digits. A six-digit code therefore has red, green and blue pairs in that order. HSL is another way to describe an RGB color: hue identifies a position on the color wheel, saturation controls distance from a gray of the same lightness, and lightness places the color between black and white. These forms are useful for comparing design tokens, reading CSS and adjusting a palette without guessing what a code means.

Choosing the right representation

The result has no alpha channel; this tool uses integer RGB and conventional HSL, not color-management profiles. Pick the form expected by the place where you will paste the result. CSS accepts both hex and rgb() or hsl() syntax, but a design system or graphics program may store channels separately. This tool uses ordinary sRGB arithmetic; it does not convert between display profiles or predict how every monitor will reproduce a color. Neither three-channel HEX nor these RGB and HSL outputs include transparency. A four- or eight-digit alpha code needs a separate operation. Integer RGB channels and displayed HSL decimals can also round, so a round trip may differ by one channel value.

How this conversion transforms the input
HEX color
Colour channels
RGB color