InputTestHub

HEX to RGB Converter

Converts HEX colour codes to RGB and RGBA values, handling 3, 4, 6 and 8 digit hex.

Colour & Design Nothing uploaded No sign-up Free, unlimited
Colour & Design tool
Pick a colour to see every value.
In short A HEX colour is just RGB written in base 16: #3A7BD5 is red 58, green 123, blue 213, because each pair of digits covers 0 to 255. Converting is mechanical, and the two places people trip are worth knowing. First, three and four digit hex is shorthand where each digit is DOUBLED, not padded — #F00 is #FF0000, not #F00000, and #ABC is #AABBCC. Getting that wrong gives a colour that is close enough to look plausible and wrong enough to fail a brand check. Second, the fourth and eighth digits are alpha. #3A7BD580 is the same blue at 50% opacity, because 80 in hex is 128 of 255. That format is well supported now and is usually tidier than switching to rgba() just to add transparency. The conversion itself is lossless in both directions — every hex code has exactly one RGB value and the reverse — so nothing is approximated here. Use RGB when you need to compute with a colour, and hex when you need to store or paste one, which is why almost every design tool speaks hex and almost every graphics library speaks RGB.

How to use the HEX to RGB Converter

  1. Pick a colour with the picker or paste a HEX, RGB or HSL value.
  2. Every other format and the generated variations update instantly.
  3. Click any value or swatch to copy it.

About the HEX to RGB Converter

The HEX to RGB Converter converts HEX colour codes to RGB and RGBA values, handling 3, 4, 6 and 8 digit hex. It runs as plain JavaScript inside the page, which means there is no upload step, no queue and no size limit imposed by a server — the only limit is your own device.

What people use it for

  • Using a hex value in a place that needs RGB.
  • Adding an alpha channel to an existing colour.
  • Converting design tokens for a codebase.

Frequently asked questions

Is the HEX to RGB Converter free, or is there a paid tier?
It is free, with no account, no trial and no daily cap. Every colour & design tool on inputtesthub.com works the same way: open the page and use it.
Is the HEX to RGB Converter safe to use with private information?
No. The HEX to RGB Converter runs entirely in your browser using JavaScript. Because the work happens locally, the page also keeps working if your connection drops, and closing the tab is all it takes to discard everything.
What does a typical result look like?
Enter #1b4dff and the HEX to RGB Converter returns rgb(27, 77, 255).
When would I actually need the HEX to RGB Converter?
The most common reasons people reach for it: using a hex value in a place that needs RGB. Adding an alpha channel to an existing colour. Converting design tokens for a codebase. It is built for exactly those cases rather than being a general-purpose tool with this bolted on.
Does the HEX to RGB Converter work on a phone?
Yes. The page is responsive and the page works in Chrome, Safari, Firefox, Edge and Samsung Internet on both Android and iOS. There is no app to install and nothing to sign into.

Related colour & design tools

All 33
01

Colour Code Converter

Converts colours between HEX, RGB, RGBA, HSL, HSLA, HSV, CMYK, LAB and named CSS colours.

02

Colour Picker

Picks any colour and shows its HEX, RGB, HSL, HSV, CMYK and LAB values, plus tints, shades and…

03

RGB to HEX Converter

Converts RGB and RGBA values into HEX colour codes, including 8-digit hex with alpha.

04

HSL Colour Converter

Converts between HSL, HEX and RGB, so you can adjust lightness and saturation predictably.

05

CMYK Colour Converter

Converts between CMYK and RGB or HEX for print work, with a note on gamut differences.

08

Colour Contrast Checker

Calculates WCAG contrast ratio between two colours and reports AA and AAA pass or fail for…

10

Tailwind Colour Converter

Finds the nearest Tailwind colour class for any hex value, and shows the hex for any Tailwind…