Blog
Unit converters

RGB to HSV converter

Enter the red, green and blue channel values (0–255), and the converter computes the HSV color: hue (H) in degrees from 0 to 360, saturation (S) and value (V) in percent.

Result

Hue (H) —
Saturation (S) —
Value (V) —
HSV string —

All calculations run locally in your browser: parsing, chart, export. Disconnect the network and the page keeps working.

Facts and limits of this method

Hue range 0° to 360°
Saturation and value range 0% to 100%
Value formula V = max(R, G, B) / 255
Saturation formula S = (max − min) / max, with max = 0 → S = 0

When it misleads you

How it is calculated

R, G and B values are normalized by dividing by 255, giving numbers from 0 to 1.

Value (V) is the maximum of the normalized R, G, B.

Saturation (S) is computed as the ratio of the difference between the max and min channel to the max (with max equal to zero, saturation is taken as zero).

Hue (H) is computed based on which of R, G or B is the maximum, using a piecewise formula that gives a value from 0° to 360°.

Questions and answers

How is HSV different from HSL?

Hue is defined the same way in both models, but saturation and lightness/value use different formulas, so identical S and L (or V) percentages in HSL and HSV produce different colors.

Why does it show a hue of 0° when S=0% and the color is gray?

Hue is mathematically undefined for shades of gray, so 0° is used by convention — it has no effect on how the gray color is perceived.

Can I use HSV directly in CSS?

Modern CSS doesn't support an hsv() function directly — for use in styles it's more convenient to convert the result to HSL or HEX/RGB with a separate converter.

Is my data sent anywhere?

No, the whole calculation runs in your browser.

Related tools

All tools