What is a color converter and why use it?
A color converter translates a color between notations. HEX, such as #2563eb, and RGB, such as rgb(37, 99, 235), describe exactly the same color: the first in base 16, the second as red, green and blue levels from 0 to 255.
Design tools usually export HEX, while CSS functions, canvas code and transparency effects often need rgb or rgba. Going the other way, you may have channel values from code and need a compact HEX for a design file. Converting by hand means working in base 16, so this tool does it instantly and shows the color so you can confirm it is right.
How to use this tool
Choose a direction
Select HEX to RGB or RGB to HEX with the tabs above the converter.
Enter or pick a color
Type a hex code or the three RGB values, or use the color picker. The swatch shows the color live, and a red message appears if the input is not valid.
Copy the result
Press Copy to put the full value on your clipboard, or use the secondary button for just the numbers or the code without the #.
How HEX and RGB are converted
A six-digit hex code is three pairs: red, green and blue. Each pair is a base-16 number from 00 to ff, which equals 0 to 255. For #ff5733: ff = 255, 57 = 87, 33 = 51, giving rgb(255, 87, 51). To go back, convert each channel to base 16 and pad it to two digits.
Three-digit hex is shorthand where each digit is doubled, so #f80 means #ff8800. Eight-digit hex adds an alpha pair; the tool converts it to a 0 to 1 opacity and returns an rgba() value.
R = hex digits 1–2 → decimalG = hex digits 3–4 → decimalB = hex digits 5–6 → decimalHEX = #RRGGBB, each channel padded to two digitsFAQ
How do I convert hex to RGB?
Split the code into three pairs and convert each from base 16 to decimal. #1e90ff becomes 1e = 30, 90 = 144, ff = 255, so rgb(30, 144, 255).
How do I convert RGB to hex?
Convert each of the red, green and blue values to base 16, pad each to two digits, and join them after a #. rgb(255, 87, 51) becomes ff, 57, 33, so #ff5733.
Does it work without the # symbol?
Yes. Both ff5733 and #ff5733 are accepted.
Does it support 3-digit hex codes?
Yes. #fff is expanded to #ffffff, which is rgb(255, 255, 255).
What about transparency?
Enter an 8-digit code such as #ff573380. The last pair is the alpha channel and the result is returned as rgba().
What range can RGB values be?
Each channel must be a whole number from 0 to 255. Anything outside that range is flagged as invalid.

