HEX to RGB
Type any HEX color code and get its RGB values instantly, with a live preview and ready-to-paste CSS. Free and private — the conversion happens entirely in your browser.
How to convert HEX to RGB
- Enter a HEX code. Type or paste a code like #1e90ff into the box — the # is optional, and shorthand codes like f60 work too. You can also choose a color with the visual picker.
- Read the RGB values. The red, green and blue components (0–255) appear instantly, along with a live preview swatch of the color.
- Copy the CSS. Grab the rgb() value, a complete CSS declaration, or the percentage form with one click.
About this tool
A HEX color code is simply three bytes written in hexadecimal (base 16): the first pair of digits is red, the second is green and the third is blue. For example, in #1e90ff the pair "1e" is 30 in decimal, "90" is 144 and "ff" is 255, giving rgb(30, 144, 255) — the color known as dodger blue. This free HEX to RGB converter does that base-16 math for you, which is handy when a design tool gives you HEX codes but your code, canvas API or plotting library expects separate red, green and blue numbers.
The converter runs completely in your browser — no uploads, no tracking of the colors you enter. It also understands shorthand codes (#f60 expands to #ff6600) and 8-digit codes with an alpha channel (#ff6600cc becomes rgba(255, 102, 0, 0.8)). Going the other way? Use the companion RGB to HEX tool, or convert to every format at once with the Color Converter.
Frequently asked questions
How does HEX to RGB conversion actually work?
Split the 6-digit code into three pairs and convert each pair from base 16 to base 10. Each hex digit is worth 0–15, so a pair is (first digit × 16) + second digit. For example "90" is 9 × 16 + 0 = 144. The three results are the red, green and blue values, each ranging from 0 to 255.
What is a 3-digit shorthand HEX code?
A 3-digit code like #f60 is shorthand where each digit is doubled: #f60 means #ff6600. It only exists for codes whose pairs happen to be doubled digits, which is why not every color has a shorthand form.
What do 8-digit HEX codes mean?
The extra fourth pair is the alpha (opacity) channel: 00 is fully transparent and ff is fully opaque. This tool converts such codes to rgba() values, with the alpha shown as a decimal between 0 and 1. 4-digit codes are the shorthand equivalent.
Is the HEX code case-sensitive?
No. #1E90FF and #1e90ff are exactly the same color. Lowercase is the most common convention in CSS, so this tool normalizes output to lowercase.