ColorPickerTools

RGB to HEX Converter

RGB to HEX converter — instant, exact, and copy-ready.

Quick answer: Enter the red, green and blue values (0–255) and the tool returns the matching hex code such as #3B82F6, along with HSL and CMYK. Copy the hex with one click.

RGB input
HEX output
HEX
#3B82F6
RGB
rgb(59, 130, 246)
HSL
hsl(217.2, 91.2%, 59.8%)
CMYK
cmyk(76%, 47%, 0%, 4%)
Core facts
InputRGB channels 0–255
OutputHEX, HSL, CMYK
Privacy100% client-side
CostFree

What is a RGB to HEX Converter?

An RGB to HEX converter turns the decimal red–green–blue channels used by screens into the six-digit hexadecimal code used in CSS and HTML. Each channel (0–255) becomes a two-digit hex pair (00–FF), so rgb(59, 130, 246) becomes #3B82F6. The color is identical; only the notation changes.

Common Uses for RGB to HEX Converter

  • Convert a color from an RGB readout or a design tool into a hex for CSS
  • Turn channel values from a canvas or an API response into a hex string
  • Check the hex equivalent before handing a color to a developer

How RGB and HEX relate

RGB and HEX describe the same color in different coordinate systems. Converting between them is a matter of arithmetic, not interpretation, so the result is exact: the tool applies the standard formula and shows the value to one decimal place.

Where the rounding happens

Channel values are rounded for display. If you round a value and then convert back, you may land one unit away from the original — that is normal and invisible on screen. Keep the original code when a perfect round-trip matters.

Frequently Asked Questions

How do you convert RGB to HEX?
Convert each channel to two hexadecimal digits: 59 → 3B, 130 → 82, 246 → F6, giving #3B82F6. The tool does this instantly and pads single digits with a leading zero.
What if a value is above 255 or below 0?
Channels are clamped to the 0–255 range, because an 8-bit channel cannot represent anything outside it.
Is rgb(59,130,246) the same as #3B82F6?
Yes — exactly the same color, written in two different notations.

More color converters

More Color Tools