Enter red, green and blue values from 0 to 255, or paste an rgb() value, to get the HEX code. It updates as you type.
Whole numbers from 0 to 255
It turns red, green and blue numbers into the HEX code that CSS, Figma, Sketch and most design tools ask for. Type the three values into R, G and B, or paste one of these into the box:
rgb(38, 166, 154)rgb(38 166 154)38, 166, 15438 166 154Values must be whole numbers from 0 to 255. Anything else gets an inline message and the last good result stays on screen. Every color has its own link, so you can send a result to a teammate with the Copy link button.
Each channel is one byte, and a byte is exactly two hexadecimal digits. Convert the three channels separately, pad each to two digits, and put a # in front.
R 38 = 2 × 16 + 6 = 26
G 166 = 10 × 16 + 6 = A6
B 154 = 9 × 16 + 10 = 9A
rgb(38, 166, 154) = #26A69A
If you write the conversion in code, the same thing is one line of JavaScript:
const hex = '#' + [r, g, b]
.map((v) => v.toString(16).padStart(2, '0'))
.join('');
The padStart call is the part people forget. Without it, a channel of 9 gives 9 instead of 09 and the code ends up the wrong length.
| Decimal | HEX pair | What it means |
|---|---|---|
| 0 | 00 | Channel fully off |
| 64 | 40 | A quarter of full brightness |
| 128 | 80 | About half |
| 192 | C0 | Three quarters |
| 255 | FF | Channel fully on |
Need to go the other way, or want alpha? Use the HEX to RGB converter. To see what a code is called, try the color name finder.
Write each of the three values in base 16 as two digits and join them after a #. For rgb(38, 166, 154), 38 is 26, 166 is A6 and 154 is 9A, so the HEX code is #26A69A. This converter does that for you as you type.
Every channel needs exactly two HEX digits. A value below 16 has only one digit in base 16, so it is padded with a leading zero. rgb(9, 9, 9) is #090909. Dropping the zero would shift the digits and give a different color.
Browsers and design tools read both the same way. #ff922e and #FF922E are one color. Pick one style and keep it across a project so searches and diffs stay tidy. The tool shows both so you can copy whichever your style guide uses.
This converter takes whole numbers from 0 to 255. If a value is a percentage, multiply it by 2.55 and round, so 50% becomes 128. If it has a decimal, round it first. Anything outside 0 to 255 is flagged instead of being clamped.
Only when each of the three pairs repeats one digit, such as #FFAA00, which shortens to #FA0. In decimal that means every channel is a multiple of 17. The Short row appears when a short form exists and says so when it does not.
Add two more digits for opacity, for example #26A69A80 for about 50%. This page outputs the opaque 6 digit code. The HEX to RGB converter handles alpha and gives you the matching rgba() value.
Pick a Zaps template for your next post, story or reel, add your photos and match it to your palette.