Hex to RGB Converter
Convert hexadecimal color codes to RGB values instantly. Supports shorthand and 8-digit hex with alpha.
Hex to RGB Converter tool
Example
Input: #C4653A
Result: RGB: rgb(196, 101, 58), HSL: hsl(19, 54%, 50%)
Each pair of hex digits is one channel in base 16: C4 = 196 red, 65 = 101 green and 3A = 58 blue. The HSL value is derived from those three channels.
Common Hex Colors and Their RGB Values
| Color | Hex | RGB |
|---|---|---|
| Black | #000000 | rgb(0, 0, 0) |
| White | #FFFFFF | rgb(255, 255, 255) |
| Red | #FF0000 | rgb(255, 0, 0) |
| Lime (pure green) | #00FF00 | rgb(0, 255, 0) |
| Blue | #0000FF | rgb(0, 0, 255) |
| Yellow | #FFFF00 | rgb(255, 255, 0) |
| Cyan | #00FFFF | rgb(0, 255, 255) |
| Magenta | #FF00FF | rgb(255, 0, 255) |
| Gray | #808080 | rgb(128, 128, 128) |
| Silver | #C0C0C0 | rgb(192, 192, 192) |
| Orange | #FFA500 | rgb(255, 165, 0) |
| Navy | #000080 | rgb(0, 0, 128) |
Computed with the converter. Names follow the CSS named colors.
- Enter a hexadecimal color code in the input field, with or without the # prefix.
- The tool accepts 3-digit shorthand (e.g., #F00), standard 6-digit (e.g., #FF5733), and 8-digit hex codes with alpha (e.g., #FF573380).
- View the converted red, green, and blue channel values (each 0-255) displayed instantly below the input.
- If you entered an 8-digit hex code, check the alpha transparency value shown as a decimal between 0 and 1.
- Click the copy button next to the RGB output to copy it in CSS-ready rgb() format for your stylesheet.
How Hex Color Codes Map to RGB
A hex color code is three numbers written in base 16. #C4653A splits into C4, 65 and 3A, which are 196 red, 101 green and 58 blue, so it equals rgb(196, 101, 58). This converter does the split for you and also gives the HSL version.
Each pair of hex digits runs from 00 to FF, which is 0 to 255 in everyday numbers. The letters A to F stand for 10 to 15. To decode a pair by hand, multiply the first digit by 16 and add the second: C4 is 12 x 16 + 4 = 196. Three channels with 256 levels each give about 16.7 million colors.
The tool reads four lengths of code. Three digits, such as #F60, is shorthand where each digit is doubled, so it means #FF6600. Six digits is the standard form. Four and eight digits add an alpha pair for transparency. You then get rgba() and hsla() output, with alpha as a decimal from 0 to 1.
You can also drag the red, green and blue sliders and watch the hex code change. If you do not know the code yet, the Color Picker lets you choose by eye. The Color Name Finder tells you the nearest CSS color name for any code.
Formula / How It Works
Sources
Frequently Asked Questions
Related Tools
RGB to HSL Converter
Convert RGB color values to HSL format. See hue, saturation, and lightness with a live color preview.
Color ToolsHSL to Hex Converter
Convert HSL color values to hexadecimal codes. Enter hue, saturation, and lightness for instant hex output.
Color ToolsColor Picker
Pick any color visually and get values in hex, RGB, HSL, and CMYK. Interactive saturation panel and hue slider.
Color ToolsColor Name Finder
Find the closest named CSS color for any hex color code. Identify colors by their standard names instantly.
Color Tools