Color values, ready for code
Hex to RGB Converter
Turn a hex code or a whole list into RGB and RGBA. Keep transparency, see the exact channel values, and export a checked list for your stylesheet or spreadsheet.
Selected color
| Line | Hex input | Converted value or error | Details |
|---|
Reports and downloads include invalid rows with their source line numbers. CSV includes exact channel bytes and alpha fractions; invalid input cells start with an apostrophe for spreadsheet safety. JSON preserves input text and adds both modern and legacy CSS. Decimal values use up to six places.
How to convert a hex list
- Paste one hex color per line, such as
#E86F66orabc. Remove CSS property names, semicolons and comma separators. - Select Convert hex to RGB. Invalid rows stay visible, with an explanation and their original line number.
- Choose an output format. Inspect a row to see its channels, then copy the report or download CSV or JSON.
The four accepted forms
#RGB:#abcexpands to#AABBCC, giving 170, 187, 204.#RGBA:#0f08expands to#00FF0088, with alpha 136/255.#RRGGBB: three exact channel bytes and full opacity.#RRGGBBAA: three channel bytes followed by an alpha byte.
Letters A to F can be uppercase or lowercase. This converter accepts a missing # as an input convenience; a CSS hex color itself needs the #.
Read the arithmetic
Each pair is a base-16 number. For #E86F66, red is 14 × 16 + 8 = 232, green is 6 × 16 + 15 = 111, and blue is 6 × 16 + 6 = 102. The result is rgb(232 111 102). RGB channel bytes are exact integers from 0 to 255.
Alpha, precision and scope
Alpha means opacity: 0 is fully transparent and 1 is fully opaque. Divide the final byte by 255. For 80, 128/255 is approximately 0.501961, not exactly 0.5. The result preserves alpha whenever it was explicitly supplied, including 00 and FF.
Modern CSS uses rgb(17 34 51 / 0.501961). Legacy CSS uses rgba(17, 34, 51, 0.501961). Percent channels are each byte × 100/255. Decimal values are rounded to six places; exact bytes and the alpha fraction remain visible and exportable.
Eight-digit input always uses CSS order, RRGGBBAA. An Android-style AARRGGBB code cannot be detected automatically and will be read in CSS order. Rearrange that source before conversion. Named colors, wide-gamut color spaces, RGB input, whole stylesheets and color-profile conversion are outside this tool's scope.
The checkerboard shows transparency. It does not flatten the color onto a background, check contrast, or guarantee the same appearance on every display. These hex and RGB values describe the same sRGB color.
Privacy and browser support
Color input stays in this page's memory. The converter sends no input to a server, uses no storage and needs no account. The shared site may load its normal analytics. Clear removes the current input and results. Copy uses your browser's clipboard feature; if it is unavailable, use Select report and copy manually.
Rules follow CSS Color Module Level 4 hex notation and RGB function syntax. The converter requires JavaScript.