HSV to HEX Converter
WM-47Paste HSV (HSB) colors and get hex codes. Write hsv(32, 100%, 100%) or just three numbers. Hex can be turned back into HSV with one more press.
Runs in your browser. Nothing is uploaded.
HSV colors, one per line (hsv(32, 100%, 100%) or 32 100 100)
Hex
How to use it
- Type or paste one HSV color per line, such as hsv(32, 100%, 100%) or 32 100 100.
- Tick uppercase or short hex if you want that style.
- Press HSV to hex.
- Copy the result, or press Hex to HSV to go the other way.
Input forms
Write the color as hsv() or hsb() with commas or spaces, or as three plain numbers: hue in degrees, then saturation and value in percent. In the function form the hue can also have a unit, deg, grad, rad or turn. Hue wraps around at 360, so 400 is the same as 40, and saturation and value are clamped to the range 0 to 100. In the function form a fourth number is read as alpha.
What comes out
The output is a 6-digit hex code, or 8 digits when the input has alpha. Uppercase letters and the short form such as #f80 are options. The HSV values are turned into 8-bit red, green and blue channels and rounded, so two slightly different HSV colors can give the same hex. HSV is not a CSS color function, so use the hex output in stylesheets.
Error messages and what to do
| Message | What it means | Fix |
|---|---|---|
Line 1: hsv() needs 3 values, plus an optional alpha, but has 2 | An HSV color needs hue, saturation and value. | Add the missing value. |
Questions people ask
How do I convert HSV to hex?
Enter the color as hsv(32, 100%, 100%) or as 32 100 100 and press HSV to hex. The tool turns it into red, green and blue and prints the hex code, here #ff8800.
What range do the HSV values use?
Hue runs 0 to 360 degrees and wraps around, and saturation and value run 0 to 100 percent. Values outside that range are clamped for saturation and value, or wrapped for hue.
Can I enter HSB instead of HSV?
Yes. hsb() works the same as hsv(), and a bare list of three numbers is read as HSV too. They are two names for one color model.
Can the hex be uppercase or short?
Yes. Tick Uppercase hex letters for #FF8800, and Short form when possible for #f80. The short form is used only when every pair of digits repeats.
Why does it not match my design tool?
Design tools may round HSV differently, or use a different color space such as a wide gamut one. This tool uses plain sRGB with 8-bit channels, so a tiny difference of 1 in a channel is possible.
About this tool
Reads hsv() or hsb(), in comma or space syntax, or a plain list of three numbers: hue in degrees (units deg, grad, rad and turn also work in the function form), then saturation and value in percent. Hue wraps around 360 and saturation and value are clamped to 0 to 100. Output is 6-digit hex, with 2 more digits when there is an alpha value. HSV is not a CSS color function, so browsers do not read hsv(); use hex or rgb() in a stylesheet. The conversion goes through 8-bit RGB, so rounding can keep a round trip from landing on the exact starting value. A color with transparency keeps its alpha as a fourth value.