RGB to HSV Converter

RGB to HSV: rgb(0, 144, 255) = hsv(206, 100%, 100%). See the formula worked step by step, a reference table, and our test of every RGB value.

How to use RGB to HSV

  1. 1Enter the RGB channels.
  2. 2Read hue, saturation and value.
  3. 3Convert to OpenCV's scale if needed: H ÷ 2, S and V × 2.55.

Features

  • Standard 0–360° / 0–100% HSV
  • Radix Colors step-9 reference
  • Exhaustive round-trip test

How RGB to HSV conversion works

HSV reads RGB as a position on a colour-picker: value is the strongest channel, saturation is how much weaker the weakest channel is (relative to the strongest), and hue comes from the channel order. Because value only depends on one channel, HSV is quick to compute and popular in graphics code.

  • R′, G′, B′ = channel ÷ 255.
  • V = max(R′, G′, B′).
  • S = (V − min(R′, G′, B′)) ÷ V, or 0 when V = 0.
  • H as for HSL: based on which channel equals V.
  • Report H in degrees, S and V in percent.

Worked example: rgb(0, 144, 255) to HSV

Here is the converter's own calculation for rgb(0, 144, 255), step by step. The result, hsv(206, 100%, 100%), is exactly what the tool above shows for this input.

  • R′ = 0 ÷ 255 = 0, G′ = 0.565, B′ = 1.
  • Cmax = 1, Cmin = 0, Δ = 1.
  • V = Cmax = 1.
  • S = Δ ÷ V = 1.
  • Blue is largest: H = 60° × ((0 − 0.565) ÷ 1 + 4) = 206.1°.
  • Rounded: hsv(206, 100%, 100%).

Radix Colors, step 9 in RGB and HSV

Step 9 (the solid background step) of each Radix Colors scale in light mode.

ColourRGBHSV
amberrgb(255, 197, 61)hsv(42, 76%, 100%)
bluergb(0, 144, 255)hsv(206, 100%, 100%)
brownrgb(173, 127, 88)hsv(28, 49%, 68%)
crimsonrgb(233, 61, 130)hsv(336, 74%, 91%)
cyanrgb(0, 162, 199)hsv(191, 100%, 78%)
grassrgb(70, 167, 88)hsv(131, 58%, 65%)
grayrgb(141, 141, 141)hsv(0, 0%, 55%)
greenrgb(48, 164, 108)hsv(151, 71%, 64%)
indigorgb(62, 99, 221)hsv(226, 72%, 87%)
irisrgb(91, 91, 214)hsv(240, 57%, 84%)
jadergb(41, 163, 131)hsv(164, 75%, 64%)
limergb(189, 238, 99)hsv(81, 58%, 93%)
mintrgb(134, 234, 212)hsv(167, 43%, 92%)
orangergb(247, 107, 21)hsv(23, 91%, 97%)
pinkrgb(214, 64, 159)hsv(322, 70%, 84%)
plumrgb(171, 74, 186)hsv(292, 60%, 73%)
purplergb(142, 78, 198)hsv(272, 61%, 78%)
redrgb(229, 72, 77)hsv(358, 69%, 90%)
rubyrgb(229, 70, 102)hsv(348, 69%, 90%)
skyrgb(124, 226, 254)hsv(193, 51%, 100%)
tealrgb(18, 165, 148)hsv(173, 89%, 65%)
tomatorgb(229, 77, 46)hsv(10, 80%, 90%)
violetrgb(110, 86, 207)hsv(252, 58%, 81%)
yellowrgb(255, 230, 41)hsv(53, 84%, 100%)

Source: Radix Colors 3.0

Precision test: every RGB value through the converter

Over all 16,777,216 RGB colours the converter produced 2,475,339 distinct HSV values; 12.188% of colours came back exactly after RGB → HSV → RGB, the worst 3 levels off (#0073FB → #0070FA), the average 0.9896.

Method: every whole-number RGB value, through the converter's own code and back, compared on the 0–255 scale (how we test).

MeasureResult
RGB values tested16,777,216
Distinct HSV results2,475,339
Came back exactly12.188%
Largest change (0–255 levels)3
Average change0.9896

Last updated · Source: Pixohub exhaustive test of lib/color-math.ts

Where you'll use RGB to HSV

Colour pickers and sliders

Most picker widgets (including the browser's own <input type=color> on many platforms) present an HSV square. Converting a known RGB tells you where to put the handles.

Image processing

OpenCV's cv2.cvtColor(img, cv2.COLOR_BGR2HSV) is the standard first step for colour-based masking, such as picking out a green screen. Note OpenCV stores H as 0–179 and S, V as 0–255 for 8-bit images.

Shaders and game engines

Unity's Color.RGBToHSV and many shader snippets use HSV to shift hue or desaturate without changing brightness.

Common mistakes

  • Comparing OpenCV HSV values with this page: OpenCV halves hue (0–179) and scales S and V to 0–255.
  • Thinking V = 100% means white. rgb(0, 144, 255) has V = 100% because blue is at full strength.
  • Using HSV saturation in CSS hsl(): the formulas differ, so the colour will change.
  • Calculating with 0–255 values and forgetting to divide by 255 first, which gives V above 1.

Frequently asked questions

What is rgb(0, 144, 255) in HSV?

hsv(206, 100%, 100%). Blue is at 255 so V = 100%; red is 0 so S = 100%; and the green/red ratio puts the hue at about 206°.

Why does OpenCV give different HSV numbers?

For 8-bit images OpenCV stores hue as 0–179 (degrees ÷ 2) and saturation and value as 0–255. Multiply its hue by 2 and divide S and V by 2.55 to compare.

Is HSV more accurate than HSL?

Neither is more accurate; they are different coordinates for the same colours. In our whole-number test, HSV kept 12.188% of RGB colours exactly, slightly more than HSL.

Can I paste HSV into CSS?

No, CSS has no hsv(). Use the HEX or rgb() value the converter also shows.

More text, code & dev tools