Free Hex to RGB Converter

Paste a HEX, RGB or HSL color and get the other formats at once, with a swatch and copy-ready CSS values.

Formats
HEX, RGB, HSL
Transparency
Alpha supported

That is not a color this tool can read. Try a hex code, rgb() or hsl().

Enter a color to convert it.

What is a Hex to RGB Converter?

A hex to RGB converter translates a web color from its hexadecimal code to separate red, green and blue values. Both describe the same color, in the notation a different tool expects.

This one works in every direction. Paste a hex code, an rgb() value or an hsl() value, or use the color picker, and every format updates together.

How to convert a color
  1. Paste a color in any supported format, or choose one with the picker.
  2. Check the swatch to confirm it is the color you expected.
  3. Copy the format you need straight into your stylesheet or design tool.

Why Convert Colors?

  • Add transparency: RGB with alpha is often the easiest way to get a see-through version of a brand color.
  • Fit the tool: design apps, stylesheets and native code all prefer different notations.
  • Adjust by eye: HSL makes a color lighter or darker by changing one number.

Color Formats This Tool Reads

Each of these can describe the same color. All of them work in modern CSS.

Format Looks like What it is
Short hex #f80 Three digits, each one doubled, so #f80 means #ff8800.
Hex #ff8800 Two hex digits each for red, green and blue, from 00 to ff.
Hex with alpha #ff880080 Eight digits, where the last two set opacity. Here 80 is about 50 percent.
RGB rgb(255, 136, 0) Red, green and blue from 0 to 255, with an optional alpha between 0 and 1.
HSL hsl(32, 100%, 50%) Hue in degrees, then saturation and lightness as percentages.

How to Read the Result

Every row is the same color, written differently.

HEX

Compact

The usual format for stylesheets and brand guides. Eight digits mean the color has transparency.

RGB

Channels

The amount of red, green and blue from 0 to 255, for tools that want separate numbers.

HSL

Adjustable

Rounded to whole numbers, so converting back can land a step away from the original.

Alpha

Transparency

Shown only when the color is not fully opaque. 1 is solid and 0 is invisible.

How Screens Make Color

A screen mixes red, green and blue light. Web colors usually store each channel in 8 bits, a value from 0 to 255, which allows about 16.7 million combinations.

Hex and RGB are two spellings of those same three numbers. HSL rearranges them into hue, saturation and lightness, which is closer to how people think about color.

The Conversion, Step by Step

A hex code is three base-16 numbers. Split it into pairs and convert each pair to decimal.

For #7c3aed:

  • Red 7c: 7 × 16 + 12 = 124.
  • Green 3a: 3 × 16 + 10 = 58.
  • Blue ed: 14 × 16 + 13 = 237.

Where Color Codes Trip People Up

The conversion is exact. The confusion lies in everything around it:

  • Alpha is not the same in every format: hex uses 00 to ff, CSS rgb() uses 0 to 1, and some tools use a percentage.
  • Android puts alpha first in its ARGB hex values, while CSS puts it last, so an eight-digit code can mean two different colors.
  • The same code can look different across screens, because displays and color profiles vary.
  • Print is a separate problem: RGB is for light on screens, and print uses CMYK, so a converted value is only an approximation.
  • Sizing the images those colors sit on? The aspect ratio calculator keeps them in shape.

Why Conversion Comes Up So Often

01

Design handoff

A design file gives one notation and the codebase wants another.

02

Transparency

Overlays and shadows often need a brand color at partial opacity.

03

Design tokens

A color system stays consistent when values are converted exactly and never eyeballed.

04

Quick variations

Moving to HSL makes hover and disabled shades simple to work out.

Who Converts Color Codes

Anyone who moves a color between tools.

Designers & Agencies

Hand developers the exact value from a brand guide.

For agencies

Developers

Translate values between CSS, native apps and design tokens.

For IT & MSPs

Brand Teams

Keep a brand color identical across every format it appears in.

For brand protection

Founders

Get a logo color into a site builder that wants another format.

For side projects

Related Tools

More utilities for building a site and a brand.

01

Calculate a ratio

Resize images and video without distortion.

Aspect ratio calculator
02

Test a regex

Build a pattern that finds color codes in a stylesheet.

Regex tester
03

Show your logo in inboxes

Build the BIMI record that displays your brand mark in email.

BIMI generator
04

Monitor your domains

Get an alert when a domain's expiry, DNS or certificate changes.

See domain monitoring

Frequently Asked Questions

Common questions about hex and RGB colors.

How do I convert hex to RGB?

Split the six digits into three pairs and convert each from base 16 to decimal. For example, ff becomes 255.

How do I convert RGB to hex?

Convert each channel to a two-digit base-16 number and join them. Paste an rgb() value above to do it instantly.

What does an eight-digit hex code mean?

The last two digits set opacity, from 00 for invisible to ff for solid.

What is a three-digit hex code?

A shorthand in which each digit is doubled, so #abc means #aabbcc.

Is hex or RGB better for CSS?

They are equivalent. Hex is shorter, while RGB is easier to read when you are working with transparency.

Why does HSL come back slightly different?

HSL is rounded to whole numbers for readability, so converting it back can shift a channel by a small amount.

Do I need to include the # sign?

No. The tool accepts a hex code with or without it.

Does this convert to CMYK?

No. CMYK depends on the printer and paper, so an exact conversion needs a color profile.

Start Today

Start Monitoring & Catching Domains Today

Join founders, agencies, and domainers already protecting their portfolio. Your first 5 domains are free.

Create Free Account

No credit card required • Cancel anytime