RGB to HSB Converter

RGB in, HSB (HSV) out — with the working shown.

To convert RGB to HSB, normalise the input, find max, min and delta, compute the components, then check the gamut. For example, rgb(47 129 247) in RGB is hsb(215.4 81% 96.9%) in HSB.

This is a free RGB to HSB converter. Type or paste any red, green and blue channel values into the field above and the HSB value updates as you type, along with every other notation the web understands. HSB is hue, saturation and brightness — the model most native color pickers use internally, also written HSV.

Conversions run entirely in your browser using the same color engine as the rest of the site: values round-trip through linear sRGB and CIE XYZ rather than through an approximation, so what you copy is accurate to the last digit the format can carry.

How to convert RGB to HSB

  1. Normalise the input. Read the RGB value and scale each component into the 0–1 range the maths expects.
  2. Find max, min and delta. Take the largest and smallest of the three channels. Their difference drives saturation; which one is largest determines the hue sector.
  3. Compute the components. Brightness is simply max, saturation is delta / max, and hue comes from the dominant channel.
  4. Check the gamut. Clamp anything that falls outside what an sRGB display can show, so the value you copy is the value you get.

Worked example: rgb(47 129 247) converts to hsb(215.4 81% 96.9%). That color is Dodger Blue, and the tool above shows each intermediate step for whatever value you enter.

Common RGB to HSB values

The twenty colors people look up most often, converted from RGB to HSB. Every row is computed by the same engine as the tool above.

ColorRGBHSB
Whitergb(255 255 255)hsb(0 0% 100%)
Blackrgb(0 0 0)hsb(0 0% 0%)
Redrgb(255 0 0)hsb(0 100% 100%)
Limergb(0 255 0)hsb(120 100% 100%)
Bluergb(0 0 255)hsb(240 100% 100%)
Yellowrgb(255 255 0)hsb(60 100% 100%)
Cyanrgb(0 255 255)hsb(180 100% 100%)
Magentargb(255 0 255)hsb(300 100% 100%)
Silverrgb(192 192 192)hsb(0 0% 75.3%)
Grayrgb(128 128 128)hsb(0 0% 50.2%)
Maroonrgb(128 0 0)hsb(0 100% 50.2%)
Olivergb(128 128 0)hsb(60 100% 50.2%)
Greenrgb(0 128 0)hsb(120 100% 50.2%)
Purplergb(128 0 128)hsb(300 100% 50.2%)
Tealrgb(0 128 128)hsb(180 100% 50.2%)
Navyrgb(0 0 128)hsb(240 100% 50.2%)
Orangergb(255 165 0)hsb(38.8 100% 100%)
Pinkrgb(255 192 203)hsb(349.5 24.7% 100%)
Goldrgb(255 215 0)hsb(50.6 100% 100%)
Crimsonrgb(220 20 60)hsb(348 90.9% 86.3%)

RGB and HSB, briefly

RGB is three channels from 0 to 255 describing how hard the display drives its red, green and blue subpixels. Valid range: 0–255 per channel.

HSB is hue, saturation and brightness — the model most native color pickers use internally, also written HSV. Valid range: H 0–360°, S and B 0–100%.

Frequently asked questions

How do you convert RGB to HSB?

1. Read the RGB value and scale each component into the 0–1 range the maths expects. 2. Take the largest and smallest of the three channels. Their difference drives saturation; which one is largest determines the hue sector. 3. Brightness is simply max, saturation is delta / max, and hue comes from the dominant channel. 4. Clamp anything that falls outside what an sRGB display can show, so the value you copy is the value you get. The converter on this page does all of it as you type, and shows the working underneath.

What is rgb(255 0 0) in HSB?

Pure red, rgb(255 0 0), is hsb(0 100% 100%) in HSB. There is a table of twenty common colors converted to HSB further up this page.

What is rgb(47 129 247) in HSB?

rgb(47 129 247) converts to hsb(215.4 81% 96.9%). It is a dodger blue, and you can paste any other value into the field at the top of the page to convert it.

Is RGB to HSB conversion lossless?

Within sRGB, yes — converting to HSB and back returns the value you started with. The only rounding happens when a component is written out to a fixed number of decimal places.

Can I use HSB directly in CSS?

Not directly — CSS has no HSB function. Convert to HEX, RGB or OKLCH for the stylesheet and keep the HSB value for your design tool.

Does this RGB to HSB converter support transparency?

Alpha is preserved wherever the target notation can carry it — eight-digit hex, rgb() / a, hsl() / a and the modern CSS spaces all round-trip an alpha channel. CMYK has no alpha, so it is dropped there.

Is my color data sent anywhere?

No. Every conversion on this site runs in your browser with no network request, no account and no analytics. You can disconnect and it keeps working.