RGB to Hex Color Converter

Formula: Hex = # + R.toString(16) + G.toString(16) + B.toString(16)

RGB to Hex Converter

Converting RGB values to hex codes is a common task in web development and design.

Conversion Formula

Hex = # + R.toString(16) + G.toString(16) + B.toString(16)

Each decimal value is converted to base 16. Values below 16 get a leading zero.

Step-by-Step Examples

R:255, G:87, B:51 = #FF5733

255=FF, 87=57, 51=33

Common Use Cases

  • CSS development
  • Design-to-code conversion
  • Color documentation

Frequently Asked Questions

How do I convert RGB to hex?

Convert each RGB value (0-255) to a two-digit hexadecimal number, then concatenate them with a # prefix.

What is RGB(0, 0, 0) in hex?

#000000 (black).

What is RGB(255, 255, 255) in hex?

#FFFFFF (white).