GamutDesk Logo
GamutDesk

W3C CSS4 HEX to HWB Converter

Convert HEX to HWB (Hue, Whiteness, Blackness) for CSS Color Level 4. Get the hwb() function, channel percentages and a live swatch in your browser.

Client-Side ArchitecturePrivate Client-Side Processing

Input

Result

H (hue)217.2°
W (whiteness)23.1%
B (blackness)3.5%
CSS hwb()hwb(217.2 23.1% 3.5%)

Technical Specification & Mathematical Principles

How the HEX to HWB Converter Works

HWB describes a color as a pure hue mixed with white and black. From normalized RGB values, whiteness is the minimum channel, W = min(R, G, B), and blackness is B = 1 - max(R, G, B). Hue is identical to HSL and HSV hue: the angle of the dominant channel on the color wheel.

In CSS Color Level 4 the color is written hwb(H W% B%). When W + B is 100% or more, the color is an achromatic gray equal to W / (W + B). HWB is popular because designers think intuitively about tinting with white and shading with black.

Frequently Asked Questions

What does hwb() look like in CSS?
Write color: hwb(217 23% 4%). The hue is in degrees, whiteness and blackness are percentages, and an optional alpha follows a slash, for example hwb(217 23% 4% / 0.5).
Is HWB supported in browsers?
hwb() is supported in current versions of Chrome, Edge, Safari and Firefox as part of CSS Color Level 4. Provide a HEX fallback for older browsers.
How does HWB relate to HSV?
They are closely related: HWB whiteness equals (1 - S) x V in HSV terms, and blackness equals 1 - V. The two models describe the same RGB cube with different axes.

Related Design & Color Instruments