RGB to HSV
Convert RGB colors to HSV / HSB values.
Type a RGB value or pick a color – the result updates instantly.
Preview
RGB to HSV Converter
Convert red, green, and blue channel values into HSV – hue, saturation, and value (also called HSB). Enter 255, 165, 0 and you get hsv(39, 100%, 100%): an orange at full saturation and full brightness. Input can be rgb() notation, plain numbers, or percentages.
From three channels to a color wheel
RGB tells you how much of each light primary to mix, which is how screens work. HSV rearranges the same information into terms that are easier to reason about:
- Hue (0–360°) – where the color sits on the wheel.
- Saturation (0–100%) – how pure the color is compared to gray.
- Value (0–100%) – how bright the strongest channel is.
Worked example: Teal
rgb(0, 128, 128) scales to R = 0, G = 0.502, B = 0.502. The maximum is 0.502 and the minimum is 0.
- Value = 0.502 → 50.2%
- Saturation = (0.502 − 0) / 0.502 = 100%
- Green and blue tie for the maximum, which puts the hue exactly between them at 180° (cyan).
Result: hsv(180, 100%, 50%) – a fully saturated cyan at half brightness, which is exactly what teal is.
| RGB | HSV |
|---|---|
| 255, 0, 0 | 0°, 100%, 100% |
| 255, 165, 0 | 39°, 100%, 100% |
| 0, 128, 128 | 180°, 100%, 50% |
| 128, 128, 128 | 0°, 0%, 50% |
Practical uses
- Computer vision: OpenCV and similar libraries threshold on hue ranges to track objects of a certain color, which is far more robust than matching RGB values. Note that OpenCV stores hue as 0–179 for 8-bit images, so halve the degrees.
- Theme generation: keep hue and saturation, step the value down, and you get a consistent set of shades.
- LED and lighting control: many smart bulbs and addressable LED libraries take hue and brightness directly.
Need a web code as well? Use RGB to HEX. To reverse this conversion, open HSV to RGB.
Frequently Asked Questions
What is the formula for RGB to HSV?
Scale R, G, and B to 0–1. Value is the largest channel. Saturation is (max − min) / max, or 0 when max is 0. Hue is 60 degrees times a position that depends on which channel is largest, for example 60 × (G − B) / (max − min) when red is largest.
Why does rgb(0, 128, 128) give a value of 50.2% instead of 50%?
Value is the largest channel divided by 255, and 128 / 255 = 0.502. RGB has 256 steps per channel, so most channel values do not map to round percentages.
What is the difference between HSV and HSB?
There is none. Brightness (B) and value (V) are two names for the same component, so HSB values from Photoshop or Figma match the HSV output here.
Can I convert RGBA to HSV?
Yes. The alpha value is ignored for the HSV result, because HSV has no transparency component. The HSV numbers only describe the color itself.