Search tools

Find a tool by name or what it does.

RGB to Hex Converter

Enter red, green, and blue values with an optional alpha and copy the matching HEX, 8-digit HEX, and HSL, next to a live swatch.

RGB channels

Each channel is 0 to 255. Everything runs in your browser. Nothing is uploaded.

Formats

HEX#6366f1
HEX8#6366f1ff
RGBrgb(99, 102, 241)
HSLhsl(239, 84%, 67%)

How to convert RGB to HEX online

  1. Enter the channels

    Type the red, green, and blue values as numbers from 0 to 255 in the three fields.

  2. Set alpha if needed

    Drag the alpha control to add transparency, or leave it at 100% for a fully opaque color.

  3. Read the codes

    The HEX, 8-digit HEX, RGB, and HSL forms and a live swatch update instantly as you change any value.

  4. Copy what you need

    Use the copy button on any row, or Copy all formats to grab every notation in one block.

Why use this tool

Separate channel fields

Red, green, and blue each get their own input, so you can nudge one value and watch the swatch and every code update at once.

HEX and 8-digit HEX together

The standard #RRGGBB code sits beside the #RRGGBBAA form that folds the alpha value into the last two digits.

Alpha carried into every form

The transparency slider flows into the 8-digit HEX, the rgba() string, and the hsla() output, so semi-transparent colors stay correct.

Values clamped and rounded

Channels outside 0 to 255 are clamped and decimals are rounded, so the output is always a valid color code.

Runs entirely in your browser

Everything happens on your device; nothing is uploaded, sent to a server, or stored.

About this tool

This converter turns red, green, and blue channel values into a HEX color code. Enter each channel as a number from 0 to 255, drag the optional alpha control, and the HEX, 8-digit HEX with alpha, RGB, and HSL forms update instantly next to a live swatch. Every value has its own copy button. Channels outside the 0 to 255 range are clamped, and decimals are rounded to the nearest whole channel, so the output is always a valid color code you can paste straight into CSS.

Reach for it whenever a design tool hands you raw RGB numbers but your stylesheet, config file, or icon export wants a HEX string. The alpha channel becomes the last two digits of an 8-digit HEX value and the fourth argument of an rgba() or hsla() string, which is handy for semi-transparent overlays and shadows. Because the three channels stay as separate fields, you can adjust one value at a time and watch the swatch shift, rather than editing a single packed string by hand.

Everything is computed in the page, so the numbers you enter are never sent anywhere. Color work rarely stops at one conversion: to read a HEX or RGB value back as every other notation use the color converter, to check a text and background pairing against WCAG rules try the contrast checker, and to build a set of tints and shades from your color open the color shades generator.

Frequently asked questions

How do I convert RGB to a HEX code?
Enter the red, green, and blue values from 0 to 255 and the HEX code appears immediately. Each channel is written as a two-digit hexadecimal number and joined into a #RRGGBB string.
What is the 8-digit HEX output?
An 8-digit HEX value, #RRGGBBAA, adds the alpha channel as a final pair of digits. It lets a single HEX string carry transparency, which is supported in CSS and most modern design tools.
What happens if I enter a value above 255?
Any channel below 0 or above 255 is clamped to that range, and decimal values are rounded to the nearest whole number, so the result is always a valid 24-bit color.
Can I get an HSL value too?
Yes. The same color is shown as hsl(), and as hsla() when the alpha is below 100%, alongside the RGB and HEX forms. Each row has its own copy button.
Is my data uploaded anywhere?
No. Everything runs in your browser; nothing is sent to a server or stored.

Related tools