Web & Developer Utilities100% Client-Side

HEX to RGB and RGBA Color Converter

Paste a hexadecimal color to see the red, green, and blue channel values as decimal numbers. The converter also gives a CSS function you can copy into a rule or inspect alongside a design token. Short HEX colors expand each digit to a pair, and colors with an alpha channel produce an RGBA result. This lets you see both the underlying color and the opacity represented by the final digits.

Input
7 chars•1 lines
Output

Reverse tool

RGB to HEX Converter

Convert decimal RGB channels and optional opacity to six- or eight-digit HEX. Copy uppercase or lowercase color values for CSS, templates, and design tokens.

Open RGB to HEX Converter

How to Use the HEX to RGB Converter Online

  1. 1Paste the hexadecimal code with or without its leading hash. Use three or six digits for red, green, and blue, or four or eight to include alpha.
  2. 2Read the CSS RGB line for a function you can paste into a stylesheet. The remaining lines show the individual channel values.
  3. 3If the result includes alpha, check whether its displayed opacity is suitable for your use. The tool rounds the opacity to two decimal places.
  4. 4Copy the CSS function or one of the channel values and compare it with the source color when exact opacity matters.

Input & Output Examples

The shorthand expands to #33aaff and produces red 51, green 170, and blue 255.

Input Sample
#3af
Expected Output
CSS RGB: rgb(51, 170, 255)
Red:   51
Green: 170
Blue:  255

The last pair encodes the alpha byte. The report shows the opacity rounded to 0.5.

Input Sample
#33669980
Expected Output
CSS RGB: rgba(51, 102, 153, 0.5)
Red:   51
Green: 102
Blue:  153
Alpha: 0.5

Practical Developer Workflows

  • Look up individual channel values for a token when a component library accepts red, green, and blue inputs separately.
  • Convert a HEX color from a design handoff to a CSS function that is easier to adjust with an explicit opacity.
  • Review which channel causes two similar brand colors to differ when comparing a design and an implementation.

Zero Server Uploads & Complete Privacy

Runs 100% in your browser; no data is uploaded to any server.

Notice a bug, calculation error, or outdated info?

Let us know directly so our engineering team can fix it.

Frequently Asked Questions

Each digit repeats to form a two-digit channel. For example, #3af expands to #33aaff. Four-digit shorthand uses the same rule for each of the red, green, blue, and alpha digits, resulting in an eight-digit color.

Explore Other Tools

12 suggested tools

View all tools