A hex to RGB example shows the relationship between a CSS hexadecimal color and its red, green, blue, and optional alpha channel values. For instance, #FF5733, a vivid orange, becomes rgb(255, 87, 51), where the first pair "FF" equals 255 red, the second pair "57" equals 87 green, and the third pair "33" equals 51 blue. Each pair is a byte, a two-digit base-16 number ranging from 00 to 255, which maps directly to one of the three color channels used by screens, canvas APIs, and CSS stylesheets. Short notation works the same way: #F00 is the three-digit form of #FF0000, which becomes rgb(255, 0, 0). When alpha is included, an eight-digit hex like #FF573380 decodes to rgba(255, 87, 51, 0.502) because the trailing 80 hex equals 128 in decimal, and 128 divided by 255 is approximately 0.502 opacity. These conversions are the foundation of every example below, and every figure shown is verifiable with a HEX to RGB Converter that parses CSS hex notation in the browser.

Common Hex Codes and Their RGB Equivalents
Many practical hex to RGB examples come from the small set of colors that show up constantly in web design, design tokens, and brand guides. The table below pairs a familiar CSS token with the exact channel values a converter returns. Numbers are written as decimal bytes because that is what stylesheets, image editors, and canvas APIs actually consume.
| CSS Hex | Red | Green | Blue | rgb() Output |
|---|---|---|---|---|
| #000000 | 0 | 0 | 0 | rgb(0, 0, 0) |
| #FFFFFF | 255 | 255 | 255 | rgb(255, 255, 255) |
| #FF0000 | 255 | 0 | 0 | rgb(255, 0, 0) |
| #00FF00 | 0 | 255 | 0 | rgb(0, 255, 0) |
| #0000FF | 0 | 0 | 255 | rgb(0, 0, 255) |
| #808080 | 128 | 128 | 128 | rgb(128, 128, 128) |
| #FF5733 | 255 | 87 | 51 | rgb(255, 87, 51) |
| #4A90E2 | 74 | 144 | 226 | rgb(74, 144, 226) |
Two of these rows are worth a closer look. #808080 sits exactly halfway between black and white because each channel byte equals 128, the midpoint of the 0 to 255 range. #4A90E2 is a typical "link blue" tone: a low red, a mid-range green, and a high blue, producing the slightly cool sky color that many UI kits reuse. Reading each pair as a separate byte is the quickest way to predict the final swatch.
Short Notation Examples: #RGB and #RGBA Forms
CSS lets you write a hex color with three digits when each pair is two copies of the same nibble. The rule is simple: every digit is duplicated in order. That is why hex to RGB examples with short notation are perfect for understanding the expansion step. Three different short inputs and their expanded forms are shown below.
- #F00 expands to #FF0000, which is rgb(255, 0, 0).
- #0F8 expands to #00FF88, which is rgb(0, 255, 136).
- #0F08 expands to #00FF0088, which is rgba(0, 255, 0, 0.533) because 0x88 equals 136 and 136 divided by 255 is approximately 0.533.
The same doubling applies to the alpha nibble in a four-digit hex. The converter treats #RGBA exactly the same way as #RGB: it expands each digit, then parses the resulting bytes. This means a designer who prefers compact tokens can type #0F08 once and still get an exact rgba() string back. The expanded lowercase form returned by the parser is always six or eight digits, so downstream systems never have to handle both lengths.
Eight-Digit Hex Examples with Alpha Channel Values
Translucent colors use the eight-digit form, which places the alpha byte at the very end. Several hex to RGB examples with alpha are useful to memorize because the relationship between the alpha byte and the displayed decimal opacity is not always obvious. The table below uses the same orange, #FF5733, paired with four different alpha bytes.
| CSS Hex | Alpha Byte | Opacity | rgba() Output |
|---|---|---|---|
| #FF5733FF | 255 | 1.000 | rgba(255, 87, 51, 1) |
| #FF573380 | 128 | 0.502 | rgba(255, 87, 51, 0.502) |
| #FF573340 | 64 | 0.251 | rgba(255, 87, 51, 0.251) |
| #FF573300 | 0 | 0.000 | rgba(255, 87, 51, 0) |
The opacity column is the alpha byte divided by 255. Byte 80, which is 128 in decimal, divides cleanly to 0.502, while byte 40 produces 0.251. Endpoint bytes 00 and FF display exactly as 0 and 1, but any other byte is shown to three decimal places with trailing zeros removed. Keeping the normalized eight-digit hex alongside the rounded decimal lets you share a translucent color without losing precision, which matters whenever a design token must round-trip back to CSS without drift.
How to Convert Any Hex Code to RGB Examples
Working through hex to RGB examples by hand is a great way to learn the structure, but most design work uses a converter to validate input and format output. The following steps describe how to use the HEX to RGB Converter to turn any valid CSS hex token into a full set of channel values.
- Paste a CSS hexadecimal color beginning with # in three-, four-, six-, or eight-digit form. For example, type #4A90E2 or its short equivalent #49E.
- Read the normalized hexadecimal value, CSS rgb() or rgba() string, and individual channel values shown beside the input. The expanded form for #49E will be #4499EE, with red 68, green 153, and blue 238.
- Check the live preview to confirm the swatch matches what you expected. For translucent colors, retain the alpha byte when exact round-trip precision matters, and copy the normalized eight-digit hex rather than the rounded rgba() string.
If the converter returns an error instead of a result, the most common causes are a missing hash, the wrong number of digits, or a non-hexadecimal character such as a space or punctuation mark. Fixing the input and reloading the field usually restores the example output immediately.
Reading the Converter Output Step by Step
A complete hex to RGB example includes four pieces of information that together describe one color. The first piece is the normalized hexadecimal value, which is always written as either six or eight lowercase digits so that downstream parsers do not need to handle shorthand. The second piece is the CSS rgb() or rgba() string, ready to paste into a stylesheet. The third piece is the individual channel bytes, useful for canvas APIs, image processing, and design tokens that store channels separately. The fourth piece is the alpha, shown as a decimal opacity alongside the exact byte.
For the example #4A90E2, the converter displays the normalized hex #4A90E2, the CSS string rgb(74, 144, 226), and the channel breakdown red 74, green 144, blue 226. The preview uses the generated CSS color in the browser, which catches obvious channel-order mistakes such as typing #E2904A and accidentally swapping the red and blue bytes. This kind of visual check matters because the parser does not interpret #AARRGGBB as a CSS color and does not reorder bytes based on appearance.
Where Hex to RGB Examples Break Down
Hex to RGB examples are reliable for the four valid CSS lengths, but the converter does not parse every shorthand that other tools accept. It does not interpret named colors such as rebeccapurple, does not accept hsl(), lab(), lch(), or color() functions, and does not read CSS variables, gradients, or comma-separated palettes. It also does not convert between color spaces, measure contrast, choose an accessible foreground, sample pixels from an image, or claim that two colors look identical. Hexadecimal CSS colors represent sRGB channel values, so they are not Pantone swatches, CMYK recipes, or physical measurements.
For a contrast ratio, the right follow-up is a dedicated Color Contrast Checker that evaluates WCAG rules against a chosen text and background pair. For a rough process-color estimate, a separate RGB to CMYK tool can translate the channels into print percentages, though a managed profile and proofing workflow remain essential for any production output. Each of those tasks lives in its own tool because color work often shifts from one representation to another, and a clean conversion at each step keeps the rest of the pipeline honest.
For a dependable workflow, copy the complete CSS token including its hash, confirm the expected number of digits is present, and compare the displayed channel values with the system that will consume them. If transparency matters, verify that the source uses CSS alpha-last order rather than the AARRGGBB order seen in some legacy platforms. Retain the normalized eight-digit hex whenever a rounded decimal alpha could lose precision, because each verified example above relies on the byte-level accuracy that the parser preserves end to end.