RGB percent to HEX

Enter each channel percentage as found in older CSS or a design app to get the usual code.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Enter red r, green g and blue b.
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

Channel = round(percent × 255 ÷ 100), so 50% gives 127.5, which rounds to 128.

Example

Inputs: Red R = 100 %, Green G = 50 %, Blue B = 0 %. Result: HEX code: #FF8000; Red R: 255; Green G: 128.

Limits and caveats

  • Rounding to whole numbers can make two very close percentages give the same code.

Questions about this tool

What is 50% in HEX?

50% of 255 is 127.5, which rounds to 128, or 80 in hex.

Do I type the % sign?

No. Type the number only, such as 50; the field is already in percent.

Can I enter decimals like 33.3%?

Yes. Decimals are accepted and the result is rounded.