Blog
Unit converters

HSV to HEX converter

Enter hue (0–360°), saturation and value (0–100%), and the converter computes the corresponding screen HEX color code and shows a swatch.

Result

HEX code —
RGB 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

Intermediate step HSV is first converted to RGB, then to HEX
Hue range 0° to 360° (out-of-range values are wrapped with modulo)
Saturation and value range 0% to 100%
Result format #RRGGBB — six hexadecimal digits

When it misleads you

How it is calculated

Saturation and value are converted to fractions from 0 to 1 by dividing by 100.

Chroma C = V × S, an intermediate value X, and the offset m = V − C are computed using the standard HSV formulas.

Depending on which of six 60° sectors the hue H falls into, the (R', G', B') values are picked from C, X and 0, m is added, the result is multiplied by 255 and rounded.

The resulting R, G, B are converted to two-digit hexadecimal pairs and joined into a 6-digit HEX code with a leading "#".

Questions and answers

What happens if I enter a hue above 360° or negative?

The converter automatically wraps hue into the 0°–360° range using modulo, so the result is always valid.

Why is the result gray regardless of hue when S=0%?

At zero saturation the color becomes achromatic (a shade of gray), and hue has no visual effect in that case.

Can I get a pure white or black HEX code?

Yes: V=100% with S=0% gives #FFFFFF (white), and V=0% (regardless of S and H) gives #000000 (black).

Is my data sent anywhere?

No, the whole calculation runs in your browser.

Related tools

All tools