Hex to RGB Converter

RGB
rgb(59, 130, 246)
HSL
hsl(217, 91%, 60%)
CMYK
cmyk(76%, 47%, 0%, 4%)

How to Use the Hex to RGB Converter

Hexadecimal color codes dominate web development — every CSS stylesheet, design token, and brand guideline references colors as #RRGGBB strings. RGB (Red, Green, Blue) expresses the identical color as three decimal numbers from 0 to 255, which JavaScript canvas APIs, Python imaging libraries, and spreadsheet conditional formatting expect. Converting between the two formats is a daily task for front-end developers and digital designers.

Enter a Hex code with or without the leading hash. Three-digit shorthand (#F00) expands to six digits (#FF0000) by doubling each character. Six-digit standard Hex splits into three byte pairs: the first pair is red intensity, the second green, the third blue. Each pair converts from base-16 to decimal — #FF equals 255, #00 equals 0, and #80 equals 128.

Eight-digit Hex (#RRGGBBAA) adds an alpha channel for transparency. The fourth pair maps to opacity where FF is fully opaque and 00 is fully transparent. The converter outputs both rgb() and rgba() CSS function syntax ready to paste into stylesheets.

Invalid characters or wrong-length codes trigger clear error messages rather than silent wrong output. Copy the RGB result for use in React inline styles, Android XML colors, or Unity material properties. Reverse the process with the RGB to Hex converter when a design tool exports decimal channels.

Whether you are translating a Figma Hex export for a Canvas animation, debugging a mismatched color between CSS and JavaScript, or learning how digital colors encode on screen, Hex-to-RGB conversion makes the underlying channel values visible.

Common use cases

  • CSS to JavaScript

    Convert Hex theme colors to RGB arrays for Chart.js, D3.js, or canvas drawing APIs.

  • Design handoff

    Translate Hex codes from design files into RGB values expected by Android or iOS native code.

  • Spreadsheet formatting

    Convert web Hex colors to RGB triplets for conditional formatting rules in Excel or Google Sheets.

  • Color learning

    See how Hex byte pairs map to decimal channels when studying digital color fundamentals.

Frequently asked questions

Three-digit Hex expands to #FFFFFF, which equals rgb(255, 255, 255) — pure white.

The last two digits are alpha (opacity). #FF000080 is semi-transparent red at roughly 50% opacity.

No. #ff5733 and #FF5733 represent the same color. Converters accept uppercase and lowercase.

Related color tools