How to convert RGB to HEX
- Paste your colours. Put one colour per line. You can convert a whole palette at once.
- Pick a direction. Press RGB → HEX or HEX → RGB.
- Copy the result. Each line of the result matches the same line of your input. Press Copy to take them all.
Good to know
- RGB values are 0 to 255. Commas, spaces or
rgb()/rgba()all work. Decimals are rounded to the nearest whole number. - Alpha is optional. Give a 4th value from 0 to 1, or 0% to 100%, and you get an 8-digit hex code such as
#BF7B6D80. - Hex works with or without #. 3- and 4-digit short codes are expanded, so
#F00becomesrgb(255, 0, 0). Codes with alpha givergba(), with alpha rounded to 2 decimal places. - Mistakes are pointed out. If a line can’t be read, the error names the line number. Blank lines are kept so the output lines up with your input.
- Hex output is uppercase. Colour names like
tomatoaren’t accepted here; the colour picker reads those.
Your colours stay on your device
Colour codes are rarely secret, but an unreleased brand palette or a client’s design system can be. Here, every line is converted inside this browser tab by a few lines of JavaScript.
The page’s security policy tells your browser to block uploads, so nothing can leave your device even by accident. You can check: open your browser’s developer tools, watch the Network tab, and convert a colour. How InTheTab works
You’ll also see a few small requests to Google Analytics. That’s our visit counter, and it never receives your files. Privacy policy
Questions
How does RGB to HEX work?
Each of red, green and blue (0 to 255) is written as two hexadecimal digits, then joined after a #. So rgb(191, 123, 109) becomes #BF7B6D: 191 is BF, 123 is 7B and 109 is 6D.
Does it accept the newer CSS syntax?
Yes, space-separated values with a slash before the alpha work, for example rgb(191 123 109 / 50%).
Can I convert HSL or CMYK here?
Not here. This converter only does RGB and HEX. The colour picker shows HEX, RGB, HSL, CMYK and OKLCH for any colour you choose.
Do I need to install anything or sign up?
No. It runs in any modern browser on Windows, Mac, Linux, Android or iPhone. It’s free and there’s no sign-up.