Next-Gen App & Browser Testing Cloud
Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles

Pick or paste any CSS color and copy it as HEX, RGB, HSL, HSV, CMYK or OKLCH, with WCAG contrast and a tint scale in the same view.
Click a row to copy that value to your clipboard.
A color converter is a browser tool that reads one color notation and rewrites the same color in every other notation. Paste #663399 and it returns rgb(102 51 153), hsl(270 50% 40%) and eleven more rows. The notations follow CSS Color Module Level 4.
Section 5.2 of that specification defines the hexadecimal notation and Section 7 defines hsl(). TestMu AI runs every matrix in the page. All processing happens in your browser. No data is uploaded.
If you only need one direction, the dedicated pages are faster: try HEX to RGB or RGB to HSL. Use this page when the input format is unknown or when you need every format at once.
Every input is normalised to one sRGB triple plus an alpha value. Hex, rgb, hsl, hwb and the CSS keywords are direct views of that triple, so those conversions are exact arithmetic with no color science involved.
OKLCH needs a longer path. The tool removes the sRGB transfer function, then applies the OKLab cube-root LMS transform rather than the XYZ route, which is what makes its lightness axis perceptually even.
Pasting a lab() or lch() value runs the reverse trip. The CIE Lab equations use the constants epsilon 216/24389 and kappa 24389/27, then the Bradford matrix adapts XYZ from D50 to D65 before the result lands back in sRGB. Contrast uses the WCAG relative luminance weights of 0.2126 red, 0.7152 green and 0.0722 blue on the linearised channels.
The widget parses ten input notations and returns the six formats people actually ship with, and clicking any row copies it. These are the controls you get in this tab:
All three are cylindrical, so each has a hue angle. They differ in what the second and third axes mean and in whether equal numeric steps look equal to the eye.
| HSL | HSV / HSB | OKLCH |
|---|---|---|
| Hue, saturation, lightness | Hue, saturation, value | Lightness, chroma, hue |
| Pure color sits at 50 percent lightness | Pure color sits at 100 percent value | Lightness is perceptual, 0 to 1 |
| Not perceptually uniform | Not perceptually uniform | Perceptually uniform by design |
| Always inside sRGB | Always inside sRGB | Can describe colors outside sRGB |
| Supported everywhere | Design tools, not CSS | CSS Color Module Level 4 |
Pick HSL for quick tweaks in legacy stylesheets, HSV when you mirror a design tool, and OKLCH when you build a scale that must keep even steps. Generate a full ramp with the Colour Shades Generator once you have the base color.
Anyone moving a color between two systems that disagree on notation. The common jobs:
Visual regression is where color drift usually surfaces. Compare rendered screenshots with TestMu AI SmartUI and run the contrast checks in accessibility testing. For a single pairing, the Color Contrast Checker gives a focused verdict, and the Color Picker helps when you have no starting value.
The input box accepts hex with 3, 4, 6 or 8 digits, rgb, hsl, hwb, cmyk, lab, lch, oklab, oklch and the 148 CSS color keywords. Whatever you paste, the tool returns the six formats people actually ship with: HEX, RGB, HSL, HSV, CMYK and OKLCH.
Split the six digits into three pairs and read each pair as a base 16 number. In #663399 the pairs are 66, 33 and 99, which are 102, 51 and 153 in decimal, so the color is rgb(102 51 153). A three digit hex such as #639 doubles each digit first.
Both start from the same hue angle. HSL puts pure colors at 50 percent lightness and reaches white at 100 percent. HSV puts pure colors at 100 percent value and never reaches white through value alone. Design tools usually expose HSV, while CSS ships hsl.
The CMYK row here is a device independent arithmetic conversion, not a profiled separation. Real presses use an ICC profile that accounts for ink, paper and dot gain, so the printed result shifts. Use this value as a starting point and let your print vendor apply the final profile.
OKLCH is a perceptually uniform polar space defined in CSS Color Module Level 4. Equal lightness steps look equally different to the eye, and changing hue does not change perceived brightness. HSL does neither, which is why HSL palettes drift darker around blue and lighter around yellow.
Lab, LCH, OKLab and OKLCH can describe colors that no sRGB monitor can show. When the converted red, green or blue channel falls outside 0 to 255 the tool clips it and flags the color as out of sRGB gamut. Lower the chroma value until the warning clears.
WCAG 2.2 success criterion 1.4.3 asks for at least 4.5 to 1 between text and its background, and 3 to 1 for large text of 18 point or 14 point bold. The converter prints the ratio against white and against black so you can pick a safe pairing immediately.
Yes in current Chrome, Firefox, Edge and Safari. The last two digits are the alpha channel read as a base 16 number, so ff is fully opaque and 80 is close to 50 percent. Older engines that predate CSS Color Module Level 4 ignore the extra pair.
For screen work yes, because hex, rgb, hsl, hsv and hwb are lossless views of the same sRGB triple. Lab, LCH and OKLCH are computed with the matrices published in CSS Color Module Level 4. CMYK and Pantone matching need a color managed workflow instead.
Yes. All processing happens in your browser. No data is uploaded. The parser, the matrices and the contrast math all run in the page, so the tool keeps working if you go offline after the first load and nothing is stored between sessions.
Hold the hue and saturation steady and step the lightness. The tool renders nine swatches from 95 percent down to 15 percent lightness in HSL and each swatch is clickable, so selecting one loads it as the new base color and recalculates every output row.
Relative luminance is the linearized brightness of a color on a 0 to 1 scale, weighted 0.2126 red, 0.7152 green and 0.0722 blue. WCAG contrast is computed from two luminance values, so it decides whether white or black text reads better on your swatch.
Did you find this page helpful?
TestMu AI forEnterprise
Get access to solutions built on Enterprise
grade security, privacy, & compliance