Enter red, green, and blue values below and the matching #rrggbb code updates live, with a swatch so you can confirm the color at a glance. Everything is computed locally — your values are never sent anywhere.

HEX#6c72ff
Worked RGB to HEX conversions
RedGreenBlueHEX
000#000000
255255255#ffffff
25500#ff0000
108114255#6c72ff
26147111#1a936f
Worked example
rgb(108, 114, 255)#6c72ff

108 → 6c, 114 → 72, 255 → ff, concatenated with a leading #.

Frequently asked questions

How do I turn RGB into a HEX code manually?

Convert each channel from decimal to two-digit hexadecimal, padding with a leading zero when needed, then join them as #RRGGBB. For example 108 becomes 6c and 255 becomes ff.

Why are some HEX codes shortened to three digits?

When all three channel pairs repeat (like #aabbcc) the code can be written as #abc. This tool outputs the full six-digit form, which always works.

What range are RGB values in?

Each of red, green, and blue runs from 0 to 255. Values are clamped to that range, since a single byte per channel cannot represent anything outside it.

Does this happen in my browser?

Yes, the conversion is pure JavaScript running locally. No RGB or HEX data is uploaded.

Related conversions

Need more options? Try the full Color Picker.