Skip to content

Hex to RGB Converter

Convert hexadecimal color codes to RGB values instantly. Supports shorthand and 8-digit hex with alpha.

Loading...
1. Enter a hexadecimal color code in the input field, with or without the # prefix. 2. 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). 3. View the converted red, green, and blue channel values (each 0-255) displayed instantly below the input. 4. If you entered an 8-digit hex code, check the alpha transparency value shown as a decimal between 0 and 1. 5. Click the copy button next to the RGB output to copy it in CSS-ready rgb() format for your stylesheet.

About This Tool

The Hex to RGB Converter translates hexadecimal color codes into their red, green, and blue component values. Whether you are working with CSS, graphic design software, or any application that requires RGB input, this tool provides instant and accurate conversions.

Hexadecimal color codes represent colors using a base-16 numbering system, where each pair of characters corresponds to the intensity of red, green, or blue on a scale from 0 to 255. This converter handles standard 6-digit hex codes, shorthand 3-digit codes, and 8-digit hex codes that include an alpha transparency channel.

Designers and developers frequently need to switch between color formats when moving work between different tools and platforms. This converter streamlines that process by giving you precise RGB values you can copy and paste directly into your code or design application.

Formula / How It Works

R = parseInt(hex[1..2], 16), G = parseInt(hex[3..4], 16), B = parseInt(hex[5..6], 16). For shorthand, each digit is doubled before conversion.

Frequently Asked Questions

Hex colors use a base-16 notation with six characters (e.g., #FF5733), while RGB specifies red, green, and blue values as integers from 0 to 255 (e.g., rgb(255, 87, 51)). Both represent the same colors - hex is shorthand for the same RGB values.
Yes. Shorthand 3-digit hex codes are expanded by doubling each character. For example, #F00 becomes #FF0000, which converts to RGB(255, 0, 0).
An 8-digit hex code includes two extra characters for the alpha (transparency) channel. For example, #FF573380 means the color #FF5733 at 50% opacity. This tool converts the alpha value to a decimal between 0 and 1.
In CSS you can use hex colors directly with the # prefix, such as color: #FF5733. You can also use the rgb() function with the converted values, like color: rgb(255, 87, 51).
Hex color codes are not case-sensitive. #ff5733, #FF5733, and #Ff5733 all represent the same color and will produce identical RGB values.

Related Tools

RGB to HSL Converter

Convert RGB color values to HSL format. See hue, saturation, and lightness with a live color preview.

Color Tools

HSL to Hex Converter

Convert HSL color values to hexadecimal codes. Enter hue, saturation, and lightness for instant hex output.

Color Tools

Color Picker

Pick any color visually and get values in hex, RGB, HSL, and CMYK. Interactive color wheel with precision.

Color Tools

Color Name Finder

Find the closest named CSS color for any hex or RGB value. Identify colors by their standard names instantly.

Color Tools

Color Shade and Tint Generator

Generate shades and tints of any color. Create darker and lighter variations for complete color scales.

Color Tools