Output will appear here
Click in the output to select all text
Output will appear here
Click in the output to select all text
Convert HEX color codes (#RRGGBB, #RGB) to RGB / RGBA values.
Convert HSL color values to standardized HEX codes.
Convert simultaneously across HEX, RGB, RGBA, HSL, HSLA, HSV, CMYK, and HWB formats.
Visual color picker showing real-time HEX, RGB, HSL, HSV, and CMYK formats.
Validate 3, 6, and 8-digit HEX color codes and normalize formatting.
Convert HSV / HSB color values to standard RGB components.
This RGB to HEX converter takes red, green, and blue numbers between 0 and 255 - or a full RGBA value with transparency - and outputs a clean, standardized hex color code ready to drop into CSS, design software, or code. It's a go-to tool for front-end developers translating a designer's RGB spec into CSS, and for anyone who needs a quick hex code generator for a color they only have as RGB numbers. Enter values into the R, G, and B fields (and optionally an alpha slider) and watch the hex output and a live swatch update instantly. There's nothing to install and nothing to upload: the conversion runs entirely in your browser, so your work stays private on your own device. Output is always correctly formatted, zero-padded, and lowercase or uppercase as needed, whether you're producing a 6-digit hex or an 8-digit hex with alpha. Scroll down and start converting your RGB values to HEX below.
Convert each of the R, G, and B decimal values (0-255) individually to a two-digit hexadecimal number, then concatenate them in order: #RRGGBB.
RGB(255, 255, 255) converts to #ffffff, which is pure white.
Yes, this tool converts the alpha value (0-1) into an extra two hex digits appended to the color, producing an 8-digit hex like #3498db80.
Yes, all modern browsers support the 4-digit and 8-digit hex-with-alpha syntax in CSS.
HEX codes are shorter, easy to copy as a single string, and are the standard format used across most design tools and CSS color pickers.
The tool automatically clamps or flags out-of-range values so the resulting hex code stays valid.
Hex vs RGB: What's the Actual Difference?
Hex vs RGB explained: they encode identical sRGB values in different bases. Here is what actually changes, when each notation wins, and how to convert.
The Complete Guide to Color Formats on the Web
A complete guide to web color formats: how HEX, RGB, HSL, HSV, named colors and alpha relate, the conversion math, and which notation to write in CSS.