Skip to main content
Calctrove Calctrove

RGB to Hex Converter

RGB to Hex converter

Convert RGB numeric channels into hex color format.

Inputs

3Live

Value 1

#3b82f6

Hex format is #RRGGBB.

Live update

Color preview

#3b82f6

Value 1

#3b82f6
Formula
Hex = concat(channel bytes in base16)

Symbol legend

Symbol Meaning Unit Copy
R,G,B RGB channel values 0 to 255
\operatorname{hex} Base16 byte conversion 00 to ff
  • Validate each channel as integer 0 to 255.
  • Convert each value to two-digit hex.
  • Join three bytes as #RRGGBB.
Example

Worked example: 59, 130, 246

  1. 1 59 becomes 3b
  2. 2 130 becomes 82
  3. 3 246 becomes f6

rgb(59,130,246) converts to #3b82f6.

How
  1. Enter R, G, and B channels.
  2. Run conversion to hex format.
  3. Copy final #RRGGBB value.
Avoid
  • Using channel values outside 0 to 255.
  • Providing decimals where integers are required.
  • Confusing RGB with BGR channel order.
Checks

Best fit

RGB to Hex Converter is built for convert rgb channel values into six-digit hex color format. If RGB to Hex Converter does not match the input scope, compare the answer with a second method.

Input check

Check R,G,B before calculating: it means rgb channel values and is measured in 0 to 255.

Sanity check

For RGB to Hex Converter, use the worked example as a quick benchmark: Rgb(59,130,246) converts to #3b82f6. If the rgb to hex converter answer is far away, check whether an input, unit, or mode changed.

Before copying

Review this common issue first: using channel values outside 0 to 255.

FAQ
Can channels be decimals?

Use integer values only for accurate byte conversion.

Does output use lowercase hex?

Yes, output is normalized to lowercase style.

Is alpha channel included?

No, this converter uses RGB only.

Switch
Switch12