This color converter reads a colour in almost any form and shows it in all the others at once. Type a hex code, an rgb() or hsl() value, HSV, HWB, CMYK, a CIE Lab value or a CSS colour name, and the page gives you every other form with a live swatch. It covers the conversions people search for most, such as HSL to HSV, hex to RGB, RGB to CMYK and RGB to Lab, in one box. It all runs in your browser.
How to use the color converter
- Type or paste a colour in the box, in any supported form.
- Check the swatch to confirm it is the colour you meant.
- Click a value to copy it, such as the hsl() or hex version.
- Edit the text to try another colour. The result updates as you type.
Colour forms the converter understands
| Form | Example | Notes |
|---|---|---|
| Hex | #2E86DE, 2E86DE, #28D | Three, four, six or eight digits; the last pair is alpha |
| RGB | rgb(46 134 222), rgb(46, 134, 222 / 50%) | Numbers 0 to 255 or percentages |
| HSL | hsl(210 73% 52%) | Hue in degrees, or deg, rad, grad, turn |
| HSV or HSB | hsv(210, 79%, 87%) | Hue, saturation, value |
| HWB | hwb(210 18% 13%) | Hue, whiteness, blackness |
| CMYK | cmyk(79%, 40%, 0%, 13%) | Percentages |
| CIE Lab | lab(53 80 67) | D65 white point |
| Name | rebeccapurple | Any CSS named colour |
HSL and HSV explained
HSL and HSV are two cylindrical reshapings of the RGB cube, and both measure hue as an angle around the colour wheel starting at red. [1] Lightness in HSL is the average of the largest and smallest channels, while value in HSV is just the largest channel. [1] That is why a fully saturated colour is at 50% lightness in HSL but 100% value in HSV. Going from HSL to HSV keeps the hue and changes only saturation and the third number, and this converter does that by passing through RGB, so every pair of models is covered.
CSS colour syntax
CSS Color Level 4 defines hex notation with three, four, six or eight digits, the rgb(), hsl(), hwb() and lab() functions, and named colours such as aqua, navy and rebeccapurple. [2] The modern rgb() syntax allows spaces between values and a slash before alpha, for example rgb(100% 0% 0% / 50%), and the older comma form still works. [2] The converter accepts both, and its results use the modern space-separated style for rgb(), hsl() and hwb().
How CIE Lab is calculated
CIELAB turns a colour into lightness L and two opponent axes, a and b. The formulas take the colour in CIE XYZ, divide by a reference white, and apply a cube-root style function with a cut-off at 6/29 cubed. [3] This page first linearizes sRGB, converts to XYZ, and uses the D65 white point. The article lists it as 95.0489, 100 and 108.884, while this tool uses the matching 95.047, 100 and 108.883 that go with its sRGB matrix, so that white comes out with a and b of zero. [3] Pure red comes out near L 53.2, a 80.1 and b 67.2. CSS defines its own lab() function, so treat the Lab value here as a plain CIE Lab reading and not as text to paste into a stylesheet.
About CMYK and Pantone
RGB and CMYK are device-dependent, and accurate conversion between them needs colour management with ICC profiles. [4] The CMYK shown here uses our own working: K is one minus the largest RGB channel, and cyan, magenta and yellow are what remains after that. It is a quick approximation, not a print proof, so ask your printer for profile-based values. Pantone and other spot-colour systems are proprietary and are not included.
Colour converter examples
- #FF0000 is rgb(255 0 0), hsl(0 100% 50%), hsv(0, 100%, 100%) and cmyk(0%, 100%, 100%, 0%).
- #FF8000 is hsl(30 100% 50%) and hwb(30 0% 0%).
- hsl(0.5turn 100% 50%) is the same cyan as #00FFFF, also called aqua.
- #2E86DE is rgb(46 134 222) and its nearest CSS name is cornflowerblue.
Which colour form should I use?
Hex is the shortest and the most common in design tools and style sheets. RGB is handy when you work with code that sets red, green and blue channels, and it is the form closest to how screens mix light. HSL is the most intuitive for adjusting a colour by hand: keep the hue, raise the lightness for a tint, lower it for a shade, or lower the saturation to mute it. HSV, also called HSB, appears in many colour pickers. HWB describes a colour by how much white and black are mixed into a pure hue. CIE Lab is useful for judging how far apart two colours look, because equal steps in Lab are closer to equal steps in perception than steps in RGB.
Transparency and alpha
If you type a colour with an alpha value, such as an eight-digit hex code, rgba() or a slash followed by a percentage, the converter keeps it. It adds the alpha to the hex, rgb, hsl and hwb results, and shows the swatch over the page background. HSV, CMYK and Lab have no alpha channel, so they describe the colour with the transparency ignored.
Reading the rounded results
Screens store each channel as a whole number from 0 to 255, so conversions are rounded to that grid. The converter works with unrounded numbers internally and rounds only for display, which keeps round trips accurate. Expect hue to be shown to a tenth of a degree and percentages to a tenth of a percent.
Common mistakes
- Forgetting the percent signs. In hsl() and hwb() the second and third numbers are percentages.
- Expecting exact matches after rounding. Colours are shown to one decimal, so a round trip can shift by one step.
- Using CMYK for print without a profile. Printed results will differ.
- Pasting Lab into CSS. The Lab shown here is a reading, not CSS syntax.
Privacy
Everything is worked out on your device. The colours you type are not sent anywhere.
What next
Use this often? Add Color to your Home screen.
Frequently asked questions
What does a color converter do?
A color converter takes a colour in one form, such as hex, and shows it in the other forms, such as RGB, HSL, HSV, HWB, CMYK and CIE Lab.
How do I convert HSL to HSV?
Type the HSL value into the box, for example hsl(210 73% 52%). The converter shows the HSV version in the list. The hue stays the same and the saturation and third number change.
Is the CMYK value exact?
No. It is a simple calculation with no colour profile. Printed colour depends on the paper, inks and profile, so ask your printer for profile-based values.
Does the color converter support Pantone?
No. Pantone is a proprietary system. The tool shows the nearest CSS colour name instead.
Are my colours uploaded?
No. The conversion runs in your browser.
Sources
Was this tool helpful?
What went wrong?
We only receive the reason you pick, never what you typed into the tool.
Thanks for your feedback.