Docomint

RGB to HEX Converter

Convert RGB red/green/blue values (0–255 each) into a 6-digit hex color code.

🔒 Processed on your device

Design specs and eyedropper tools sometimes hand you three separate RGB numbers instead of a ready-to-use hex string — this converts them the other direction from HEX to RGB, turning each 0–255 channel into its 2-digit hex pair so you can paste one short code into CSS instead of three long ones.

Example: RGB values of 37, 99, 235 (a mid-blue) convert to 25, 63, eb in hex — assembled as #2563eb, the compact form most CSS and design tools expect.

How it works

  1. Drag the R, G, and B sliders to the values you have (0–255 each)
  2. Each channel is converted to a 2-digit hex pair on your device
  3. Copy the resulting 6-digit hex code

Frequently asked questions

Can RGB values be decimals?

Standard 8-bit RGB values are always whole numbers from 0–255 — decimals only show up in the newer CSS Color 4 percentage syntax (e.g. rgb(14.5% 38.8% 92.2%)), which this tool doesn't use.

Is hex or RGB more precise?

Neither — a standard 6-digit hex code and 8-bit RGB (0–255 per channel) represent exactly the same 16.7 million colors with no precision lost converting between them. They're just two ways of writing the identical number.

Is my color values uploaded anywhere?

No — RGB to HEX Converter runs entirely in your browser using JavaScript/WebAssembly. Your color values is never sent to a server.

Related tools