RGB 0-1 float to 0-255

Enter the three floats to get an rgb() string and a HEX code for the web.

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

Each channel = round(value × 255), so 0.5 × 255 = 127.5 rounds to 128.

Example

Inputs: Red R = 1, Green G = 0.5, Blue B = 0. Result: CSS rgb(): rgb(255, 128, 0); Red R: 255; Green G: 128.

Limits and caveats

  • HDR values above 1 are rejected because a standard screen cannot show them.
  • Rounding to 256 steps loses very small differences between floats.

Questions about this tool

What is 0.5 in 0-255 RGB?

0.5 × 255 = 127.5, which rounds to 128, or 80 in hex.

Why does the color not match Blender?

Blender often shows linear values; convert them to sRGB first, then use this tool.

Can I enter more than 3 decimals?

Yes. Any precision works and the result rounds to the nearest whole number.