Skip to content

HEX to RGB Converter (Color Code)

Convert any HEX color code to RGB instantly and free. e.g. #3B82F6 → rgb(59, 130, 246). Live preview and copy-ready CSS for your stylesheet.

1.00
CSS rgb()

rgb(10 124 255)

HEX

#0a7cff

CSS hsl()

hsl(212 100% 52%)

HSV

hsv(212 96% 100%)

CMYK

cmyk(96% 51% 0% 0%)

CSS oklch()

oklch(0.608 0.215 257.4)

#0A7CFF

Best contrast vs

black textratio 5.34:1 (WCAG AA needs 4.5:1)

Paste a HEX color like #0a7cff and we return the rgb() value, the individual R/G/B channels, and a live swatch. The conversion is a straight base-16 to base-10 decode - same result every tool produces; we just save you the maths.

How to use it

  1. Choose the input format

    Pick HEX, RGB, HSL, HSV/HSB, CMYK, OKLCH or CSS name from the format selector.

  2. Type or paste your color

    Enter the value - or use the color picker and alpha slider - and every other format updates live.

  3. Copy the format you need

    Use the copy button next to the format your destination expects.

What is it?

A HEX code is the base-16 way of writing an RGB color: #RRGGBB, where each pair (00 to FF) is a red, green or blue channel from 0 to 255. Converting HEX to RGB is simply decoding each pair from hexadecimal to decimal.

When to use it

Pulling a color out of a mockup or stylesheet into rgb() so you can add transparency with rgba(), or feeding RGB channel values into code or an API that doesn't accept HEX.

Common mistakes

Forgetting the leading #, mixing up the 3-digit shorthand with the full 6-digit form, and assuming a HEX code carries transparency - that's the 8-digit form (#RRGGBBAA), which adds an alpha channel.

FAQ

How do I convert #FFFFFF to RGB?
#FFFFFF is rgb(255, 255, 255) - pure white. Each pair of hex digits is one channel, and FF is the maximum (255). By the same logic #000000 is rgb(0, 0, 0), black.
What is #3B82F6 in RGB?
rgb(59, 130, 246). The pairs decode as 3B = 59, 82 = 130, F6 = 246. Paste any code above to see it instantly.
Can I use a 3-digit HEX code?
Yes. A shorthand like #0af expands by doubling each digit: #0af = #00aaff = rgb(0, 170, 255).

Rate this tool

Share your experience to help others.

Color Converter (HEX, RGB, HSL)

Convert colors between HEX, RGB, HSL, HSV, CMYK and OKLCH.

Try it out

More in this category