Skip to content

Convert RGB color to HEX

Convert RGB values (0-255 per channel) to their equivalent hexadecimal code, with a color preview.

Processed on your device. Nothing is sent to any server.

HEX

#0B6E63

Converts each decimal channel to its two-digit hexadecimal representation and concatenates them in the #RRGGBB format.

Use cases

  • Converting a color picked from a design tool to HEX for CSS.
  • Documenting brand colors.
  • Previewing an RGB color visually.

How it works

  1. 1

    Adjust R, G and B

    Enter the red, green and blue values between 0 and 255.

  2. 2

    Copy the HEX

    The hexadecimal code is calculated instantly.

Technical details

  • Example: rgb(255, 99, 71) → #FF6347.
  • Values outside 0-255 are clamped to the nearest limit and decimals are rounded. The code is returned in upper case with 6 digits.
  • If your color has transparency (rgba), the alpha channel isn't part of this code.

Frequently asked questions

What happens if I enter a value outside 0-255?

The value is automatically clamped to the nearest valid range.

← Colors & design