Skip to main content

Free HEX to RGB Converter – Convert Color Codes Instantly

HEX to RGB Converter changes hex color codes to RGB and RGBA values instantly online for free. Live preview and copy-ready CSS in your browser.

Written & reviewed by Helperzy Editorial Team · Updated July 2026

Live PreviewRGB & RGBAHSL Output3 & 6 digit hexFree

Preview

#3498db

Converted Values

RGB
rgb(52, 152, 219)
RGBA
rgba(52, 152, 219, 1)
HSL
hsl(204, 70%, 53%)

100% Private

All color conversion runs locally in your browser. Nothing is uploaded.

How to Use HEX to RGB Converter

1

Enter a HEX Code

Paste or type a hex color code such as #3498db into the input field. The # is optional, and both three-digit shorthand like #f90 and full six-digit codes are accepted. Case does not matter, so #FFF and #fff behave the same.

2

View RGB & Preview

As soon as the code is valid, the RGB values and a live color swatch update instantly. Check the swatch against the shade you expected so you can catch a mistyped digit before it reaches your stylesheet.

3

Copy the Value

Copy the rgb() or rgba() string straight into your CSS or design tool. Use the rgba() form when you need transparency, since it works more widely across browsers than an eight-digit hex code.

What a HEX to RGB Converter Does and How It Works

A HEX to RGB converter reads a hexadecimal colour code and rewrites it as the three RGB channel numbers that browsers and design tools actually use. You type something like #3498db and get rgb(52, 152, 219) back, along with a swatch that paints the colour on screen. Front-end developers, UI designers, and anyone editing CSS reach for this constantly, because brand palettes and design handoffs usually arrive as hex strings, while a lot of styling work, especially anything involving transparency, needs the decimal RGB form. Converting on the spot saves you from doing hexadecimal arithmetic in your head and from the classic slip of copying one digit wrong and ending up with a colour that is almost, but not quite, right. A hex code is simply base-16 shorthand for the same three numbers. After the # it holds three pairs of digits, one each for red, green, and blue, and every pair runs from 00 to FF, which is 0 to 255 in ordinary decimal. To convert, the tool splits the string into those pairs and turns each one from base 16 into base 10: the first hex digit is multiplied by 16 and the second is added on top. Shorthand three-digit codes like #f90 are expanded first by doubling every digit, so #f90 becomes #ff9900 before the maths runs. Add an alpha value and it is written either as a fourth pair or as a 0-to-1 decimal in the rgba() form. Going the other way, RGB back to hex divides each channel by 16 and keeps the quotient and remainder as two hex digits. Work through #3498db to see it clearly. Split it into 34, 98, and db. The red pair 34 means 3 × 16 + 4, which is 48 + 4 = 52. The green pair 98 means 9 × 16 + 8, or 144 + 8 = 152. The blue pair db means 13 × 16 + 11, because d is 13 and b is 11, giving 208 + 11 = 219. Put together that is rgb(52, 152, 219), a mid blue. If you then want it half transparent for an overlay, the same channels become rgba(52, 152, 219, 0.5). Enter #3498db in the tool and those exact numbers appear at once, with the swatch confirming the shade before you paste it anywhere. The day-to-day jobs are small but frequent. A developer pulls #1a73e8 from a Figma file and needs rgb(26, 115, 232) to build a semi-transparent button hover state with rgba(). A marketer hands over a brand hex and you convert it to RGB to match it in a video timeline that only accepts decimal channels. Someone building an HTML email converts hex to RGB because certain older mail clients render rgb() more reliably than a bare hex string. A data-visualisation author turns a palette of hex codes into RGB arrays to feed a charting library. Each of these is a case where the conversion decides whether the colour matches the brand exactly or lands subtly off. A few things trip people up. The most common is dropping or adding a digit, so a six-character code becomes five and the result looks nothing like the intended colour; always check you have exactly three or six hex digits after the #. Hex is case-insensitive, so #FFF and #fff are identical. Eight-digit hex with alpha is not supported by every browser, so for wide compatibility use the rgba() output instead. And everything here runs in your browser with plain arithmetic, so there is no server involved, the tool keeps working offline once the page has loaded, and no colour you test is uploaded, logged, or stored anywhere.

HEX to RGB Converter Formula & Method

HEX is base-16; each pair of digits is one RGB channel (00–FF = 0–255). Channel value = (first digit × 16) + second digit Example: db = (13 × 16) + 11 = 219 Shorthand #rgb expands by doubling each digit: #f90 → #ff9900 RGB → HEX: each channel ÷ 16 → quotient and remainder written as two hex digits.

Examples: HEX to RGB Converter

Input

#3498db

Result

rgb(52, 152, 219)

34→52, 98→152, db→219, e.g. db = 13×16 + 11 = 219.

Input

#f90 (shorthand)

Result

rgb(255, 153, 0)

Expands to #ff9900; ff = 255, 99 = 153, 00 = 0.

Frequently Asked Questions – HEX to RGB Converter

Paste your hex color code, such as #3498db, into the input field and the RGB values appear instantly as rgb(52, 152, 219). The Helperzy converter splits the hex string into its red, green, and blue parts automatically and shows a live preview.