RGB to HEX Converter

Convert RGB color values to a HEX code instantly. Enter the red, green, and blue channel values (0 to 255 each) and get the hex color code to use in CSS, Figma, Sketch, or anywhere else that expects a hex string. RGBA, HSL, and HSLA outputs are included automatically.

All processing happens in your browser. No data is sent to any server.

Frequently Asked Questions

What range of values do R, G, and B accept?
Each channel accepts an integer from 0 to 255. Values outside this range are clamped. You can also enter a CSS rgb() string like rgb(74, 144, 226) directly into the input field.
How do I convert RGB to HEX manually?
Convert each channel value from decimal to hexadecimal, then zero-pad to two digits and concatenate. For example, rgb(74, 144, 226) becomes 4A, 90, E2, giving #4A90E2.
When should I use HEX instead of RGB?
HEX codes are the most common format in CSS and HTML, accepted by every browser, design tool, and graphics application. Use HEX when you need a compact, universally compatible color value.
Does it support RGBA with an alpha channel?
Yes. Enter an rgba() value and the tool will extract the RGB channels and convert them to HEX. The alpha value is shown separately in the RGBA and HSLA outputs.

Related Tools