HEX to RGB percent

Enter a color code to get each channel as a percentage of its maximum.

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 hex color.
  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

Percent = channel ÷ 255 × 100, so 128 ÷ 255 × 100 = 50.2%.

Example

Inputs: HEX color = #FF8000. Result: Percent rgb(): rgb(100%, 50.2%, 0%); Red R: 100%; Green G: 50.2%.

#FF8000
rgb(100%, 50.2%, 0%)

Limits and caveats

  • Percentages in the CSS string are rounded to one decimal.

Questions about this tool

Does CSS accept percentage colors?

Yes. rgb(100%, 50%, 0%) has been valid since CSS2, but you cannot mix percentages and numbers in one color.

Why is 128 equal to 50.2% and not 50%?

Because 50% of 255 is 127.5, and 128 is slightly more.

Are these CMYK ink percentages?

No, they are RGB light levels on screen. Ink percentages need a CMYK conversion.