RGB to HEX Converter
Convert RGB values to a HEX color code and see how: each channel divided by 16, the remainders as hex digits, plus #RRGGBBAA alpha and shorthand.
Converting the other way? HEX to RGB converter →
RGB describes a screen color as red, green and blue intensities from 0 to 255. HEX writes the same three numbers in base 16, two digits each, so 255 becomes FF and the color becomes a compact code like #1E90FF. This converter gives you the code and shows the working, which is handy for homework, exams or checking a value by hand.
How to use this tool
- Enter red, green and blue from 0 to 255.
- Optionally set an opacity below 100% to get an 8-digit #RRGGBBAA code.
- Read the HEX code, its 3-digit shorthand (if one exists) and the step-by-step table.
- For several colors, paste one RGB triple per line into the batch box.
Formula
For each channel: quotient = ⌊value ÷ 16⌋, remainder = value mod 16; the HEX pair is the digit for the quotient followed by the digit for the remainder (10 = A, 11 = B, 12 = C, 13 = D, 14 = E, 15 = F).
Opacity becomes a fourth pair: round(opacity × 255). A shorthand #RGB exists only when every pair is a repeated digit, e.g. #FF8800 = #F80.
Example
rgb(30, 144, 255): 30 ÷ 16 = 1 remainder 14 → 1E; 144 ÷ 16 = 9 remainder 0 → 90; 255 ÷ 16 = 15 remainder 15 → FF. Together: #1E90FF (dodger blue). At 50% opacity, 0.5 × 255 = 127.5 rounds to 128 = 80, giving #1E90FF80.
Frequently asked questions
How do I convert by hand without a calculator?
Divide by 16: the whole-number part is the first digit, the remainder the second. For 200: 200 ÷ 16 = 12 remainder 8 → C8.
Why does my design tool show a different HEX for the same color?
Usually because the tool works in another color profile (Display P3, Adobe RGB) and converts. HEX in CSS always means sRGB.
Can every color be shortened to 3 digits?
No. Only 4,096 colors whose pairs are doubled digits (00, 11 … FF) have a shorthand.
Last updated:
Page address with these inputs: https://kakao.mobile/tools/how-rgb-to-hex-converter/
Cite or embed this tool
kakaoCalc. (2026, November 8). RGB to HEX Converter. https://kakao.mobile/tools/how-rgb-to-hex-converter/
“RGB to HEX Converter.” kakaoCalc, 8 Nov. 2026, kakao.mobile/tools/how-rgb-to-hex-converter/.
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