RGB to Hex Converter

Convert RGB channel values into a hex colour code.

Ad placeholder (leaderboard)
Enjoying the tools? Go Pro for £4.99 (one-time) and remove all ads — forever, on this device. Remove ads — £4.99

Enter red, green and blue values from 0–255 and get the matching hex colour code straight away, with a live swatch you can copy into CSS, SVG, or any design tool.

How it works

A hex colour code packs the three RGB channels into a base-16 string. The converter takes each channel value (0–255), converts it to a two-digit hexadecimal number, and joins the three pairs in red-green-blue order, prefixed with #. Values outside 0–255 are clamped. Because one hex digit covers 0–15, two digits cover the full 0–255 range of a channel, so the result is always #rrggbb.

Example

Convert rgb(59, 130, 246):

  • 59 → 3b
  • 130 → 82
  • 246 → f6
  • Result: #3b82f6
RGBHex
rgb(0, 0, 0)#000000
rgb(255, 255, 255)#ffffff
rgb(255, 0, 0)#ff0000
rgb(59, 130, 246)#3b82f6

It all runs in your browser — nothing is uploaded.

Ad placeholder (rectangle)