RGB 0-255 to 0-1 float
Enter the three channels and choose the decimals to get the values and a vec3 ready to copy.
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
- Enter red r, green g, blue b and decimals.
- The result appears straight away and updates as you edit.
- Copy the result, or copy a link that keeps the same values to share it.
How it is calculated
Each channel ÷ 255, for example 128 ÷ 255 = 0.502.
Example
Inputs: Red R = 255, Green G = 128, Blue B = 0, Decimals = 3. Result: Values 0 to 1: 1, 0.502, 0; Red R: 1; Green G: 0.501961.
Limits and caveats
- Values stay in sRGB; some engines expect linear values and need an extra gamma conversion.
Questions about this tool
Why divide by 255 and not 256?
Because 255 is the top value, so dividing by it maps 255 to exactly 1.0 and 0 to 0.
Are these values linear or sRGB?
They are sRGB as entered. If the engine wants linear color, apply the sRGB curve first.
Where is this format used?
Unity Color, UIColor and SwiftUI, and vec3 values in OpenGL and WebGL shaders.
