HEX to RGB Converter
Convert HEX color codes (#RGB, #RGBA, #RRGGBB, #RRGGBBAA) to rgb()/rgba(), 0–1 floats, GLSL vec4 and Unity Color, one code or a whole list.
Need HSL, CMYK or other formats too? Color converter →
A HEX color such as #1E90FF is just three numbers written in base 16: one pair each for red, green and blue. This converter turns HEX codes into rgb()/rgba() for CSS and into the 0–1 floating-point values game engines and shaders expect — including the alpha pair of 8-digit codes — for one color or a whole list.
How to use this tool
- Type or paste a HEX code; the # is optional and 3-, 4-, 6- and 8-digit codes work.
- Read rgb(), rgba(), the individual channels and the float formats.
- Choose how many decimals the floats should have.
- To convert many colors, paste one code per line into the batch box.
Formula
Each pair XY → X × 16 + Y, where A = 10 … F = 15. Float = value ÷ 255. Short codes double each digit: #F80 = #FF8800.
The fourth pair of an 8-digit code is alpha: 00 is transparent, FF opaque, 80 ≈ 50%. Linear-light floats undo the sRGB curve: ((v/255 + 0.055)/1.055)^2.4 above 0.04045, (v/255)/12.92 below.
Example
#1E90FF: 1E = 1×16 + 14 = 30, 90 = 9×16 + 0 = 144, FF = 15×16 + 15 = 255, so rgb(30, 144, 255). As floats that is 0.118, 0.565, 1.000, and as one 24-bit integer 2,003,199.
Frequently asked questions
What does an 8-digit HEX like #FF000080 mean?
The last two digits are alpha. 80 hexadecimal is 128, and 128 ÷ 255 ≈ 0.502, so #FF000080 is red at about 50% opacity: rgba(255, 0, 0, 0.502). All current browsers support it.
Should I use normalized or linear floats in Unity?
Unity's Color constructor takes sRGB values ÷ 255 (the normalized floats); in a linear-color-space project Unity converts them itself. Use the linear values only where code expects linear light, such as raw shader uniforms.
Is HEX case-sensitive?
No. #1e90ff and #1E90FF are identical.
Last updated:
Page address with these inputs: https://kakao.mobile/tools/hex-to-rgb-tool/
Cite or embed this tool
kakaoCalc. (2026, November 8). HEX to RGB Converter. https://kakao.mobile/tools/hex-to-rgb-tool/
“HEX to RGB Converter.” kakaoCalc, 8 Nov. 2026, kakao.mobile/tools/hex-to-rgb-tool/.
Paste this code into your page. The widget runs in your visitors' browsers, shows no ads and keeps a link back to this page. Embedding terms