RGB to HEX Converter — Free, Instant Color Conversion

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 color formats can I enter?
You can type a color in any common CSS format: a HEX code (#6366F1 or #f00), an RGB value (rgb(99, 102, 241)), RGBA with transparency (rgba(99, 102, 241, 0.5)), HSL (hsl(239, 84%, 67%)), HSLA, or a named CSS color like 'blue' or 'coral'. You can also click the color swatch to open your browser's color picker.
What formats does it output?
The tool shows all six formats simultaneously: HEX, HEX with alpha, RGB, RGBA, HSL, and HSLA. Each row has a Copy button so you can grab exactly the format you need.
When should I use HEX vs RGB vs HSL?
HEX is the most widely supported format and works everywhere (CSS, design tools, code editors). RGB is useful when you need to manipulate channel values or pass colors to JavaScript. HSL is the most human-friendly: adjusting lightness or saturation to create shades and tints is intuitive in a way that HEX and RGB are not.
How do I use this for transparent colors?
Enter an RGBA or HSLA value with an alpha less than 1, for example rgba(99, 102, 241, 0.5). The tool shows the 8-digit HEX (with alpha) and the RGBA and HSLA values with the correct opacity. The color preview bar uses a checkerboard background to make transparency visible.

Related Tools