RGB to HEX Converter

Convert red, green and blue values to a HEX color code.

Loading tool…

What the RGB to HEX Converter does

Enter red, green and blue values from 0 to 255 and the tool shows the HEX code, the HSL value and a swatch of the resulting color.

Invalid values such as 256 or decimals are rejected with a clear message.

How to use it

  1. Enter the three channel values.
  2. Check the swatch.
  3. Copy the HEX or HSL result.

Practical examples

  • rgb(37, 99, 235) = #2563EB.
  • rgb(0, 0, 0) = #000000.

Features

  • Validation of 0–255 whole numbers
  • HEX, HSL and CSS output

Limitations

  • Only whole-number channel values are accepted.
  • sRGB only.

Privacy

This tool runs entirely in your browser. What you type is not sent to our servers and is discarded when you close or reload the page.

Frequently asked questions

Why must values be whole numbers?

Each channel is stored as one byte, so it has exactly 256 possible values.