HWB to HEX converter

Pick a hue plus whiteness and blackness percentages to get the color in the usual web formats.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Enter hue h, whiteness w and blackness b.
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

If W + B ≥ 100% the color is gray at W ÷ (W + B). Otherwise take the pure hue color and set channel = pure × (1 − W − B) + W.

Example

Inputs: Hue H = 200 deg, Whiteness W = 20 %, Blackness B = 20 %. Result: HEX code: #3399CC.

Limits and caveats

  • Follows the CSS Color 4 algorithm in sRGB; results are rounded to whole numbers.

Questions about this tool

What is HWB?

A color model that starts from a pure hue and mixes in white and black, close to how painters tint and shade.

What if whiteness plus blackness exceeds 100%?

The color becomes gray, the hue is ignored, and the gray level is whiteness ÷ their sum.

Do browsers support hwb()?

Yes. Modern browsers support hwb() from CSS Color 4, written as hwb(200 20% 20%).