Color Converter

Convert any color between HEX, RGB, HSL, HSV, HWB, CMYK and OKLCH, with every field editable.

Color Converter tool

About the Color Converter

Design tools, stylesheets, print files and brand guides each describe colors in their own notation, and moving between them by hand invites mistakes. This color converter accepts a color in almost any format, including HEX, rgb(), hsl(), hwb(), HSV, CMYK, OKLCH and the 148 CSS color names, and shows every other format at once. Each field can be edited directly, so you can nudge the lightness in HSL and see the new HEX code immediately.

Every field is editable. Change the lightness in the HSL field, adjust a channel in RGB or type a new CMYK mix, and all the other formats update instantly, so you can work in whichever model makes the change easiest. Colors with transparency are supported too: eight-digit HEX codes, rgba() and the slash syntax of modern CSS keep their alpha value in every format that allows it.

OKLCH is the newest CSS color format and the most useful one for design systems, because its lightness matches what the eye perceives, so colors with the same L look equally light. The converter also names the closest CSS color, measures the contrast against white and black text, and warns you when a color from a wider gamut has to be adjusted to fit ordinary screens.

For a quick visual pick, use the color picker. To check readability, try the color contrast checker, and to build a full scale from one color, the color shades generator.

How to use the Color Converter

  1. Enter a colorType or paste a color in any format, or use the color picker.
  2. Read the formatsHEX, RGB, HSL, HSV, HWB, CMYK and OKLCH appear at once with a preview.
  3. Edit any fieldChange a value in any format and the others follow.
  4. Copy what you needUse the copy button next to the format your project uses.

Color Converter features

  • Reads HEX, rgb, hsl, hwb, hsv, cmyk, oklch, oklab and names
  • Every output field is editable
  • Alpha transparency kept where possible
  • Modern OKLCH output for CSS
  • Closest CSS color name
  • Contrast against white and black
  • Gamut warning for out-of-range colors
  • Copy buttons for every format

Common uses

  • Turning brand HEX codes into HSL or OKLCH for CSS
  • Converting screen colors to approximate CMYK for print briefs
  • Moving colors between design tools that use different models
  • Checking whether white or black text suits a background
  • Learning how color models relate to each other

Converting colours in practice: HSB values from design tools, OKLCH lightness, mobile app formats, Tailwind classes and avoiding round-trip losses

By the FreeToolsWorld editorial team · Updated November 2026 · How we write and check our guides

Different tools describe colours in different ways: designers in HSB, web developers in HEX or HSL, mobile developers in their platforms' own formats and modern CSS in OKLCH. Converting accurately between them keeps a brand consistent everywhere. This guide converts a colour from a design tool's HSB values and covers OKLCH, mobile formats, Tailwind classes and why repeated conversions can lose colour.

A worked example: HSB from a design tool

A designer specifies a dark green in an image editor's HSB fields as hue 145, saturation 98 and brightness 25. Converted, that is #01401B, which in HSL is about 145 degrees, 97 percent saturation and 13 percent lightness. HSB, called HSV in many tools, and HSL share the same hue but measure saturation and lightness differently, so copying the numbers directly from one to the other gives the wrong colour.

Why OKLCH is useful

In OKLCH, the lightness value matches how bright colours look to people far more closely than HSL does. Two colours with the same OKLCH lightness appear equally light, even with different hues, which makes it easier to build palettes where yellow and blue buttons have similar visual weight, and to create predictable lighter and darker steps.

Mobile app formats

Android colour resources use #AARRGGBB, with alpha first, while CSS puts alpha last. iOS code often expresses colours as fractions from 0 to 1 for each channel. Converting brand colours into each platform's format, and documenting them together, keeps web and app colours identical.

Tailwind and utility classes

Tailwind CSS accepts arbitrary colours inside square brackets, such as bg-[#15803d], but defining brand colours in the configuration with names is cleaner. Converting colours to the format your configuration uses, whether HEX, RGB or OKLCH, lets you add them once and use names everywhere.

Round trips lose colour

Converting a vivid screen colour to CMYK and back produces a duller colour, because the vivid parts outside the printable range are lost along the way. Rounding in each conversion also nudges values slightly. Keep the original value as the master and convert from it each time, rather than converting a converted value again.

Wide-gamut colours

Newer screens can display colours beyond the standard sRGB range, and CSS can describe them with formats such as display-p3. A colour defined in a wide gamut may be clipped on standard screens. For brand colours that must look the same everywhere, staying within sRGB is the safest choice.

Named colours and keywords

CSS colour names such as seagreen convert to exact HEX values, which is helpful when replacing names in an older stylesheet with brand colours. Keywords such as currentColor and transparent are not fixed colours and have no single conversion, because their result depends on context.

Documenting a colour fully

For each brand colour, record HEX for the web, RGB for office software and design tools, HSL or OKLCH for building variations, CMYK for print and any spot colour reference. A one-page table with all forms prevents each team converting colours separately and getting slightly different results.

Common mistakes

  • Copying HSB values into HSL fields.
  • Putting alpha in the wrong position for Android.
  • Converting already converted colours repeatedly.
  • Defining brand colours outside the sRGB range.

Related tools

To convert HEX codes specifically, use HEX to RGB Converter. To build lighter and darker steps, try Color Shades Generator, and for print values, RGB to CMYK Converter.

Percentages and decimals

Some tools express RGB channels as percentages or as decimals between 0 and 1 rather than 0 to 255. Converting carefully, by multiplying and rounding consistently, avoids tiny differences that make two supposedly identical colours fail an exact comparison in code or design reviews.

Storing colour parts in CSS

Storing a brand colour's hue, saturation and lightness as separate custom properties lets other colours be calculated from them, for example a hover colour with lightness reduced by a few points. Converting the brand colour into HSL or OKLCH once makes this pattern possible and keeps all variations mathematically related.

Colours in SVG files

SVG graphics accept HEX, RGB and HSL values for fills and strokes, but some older editing tools and icon pipelines handle only HEX. Converting colours to HEX before editing SVG icons by hand avoids surprises when the files pass through other tools.

Checking visually

After any conversion, place the original and converted colours side by side. A correct conversion is indistinguishable; a visible difference points to a mistake, such as swapped channels, a misread format or values entered in the wrong fields, which is far easier to catch now than after launch.

Keep a conversion record

When a colour is converted for a particular platform, note the source value, the target format and the result in your brand documentation. If a discrepancy appears months later, the record shows exactly where each value came from, and nobody has to guess which of several conversions is the official one.

Privacy

Conversions run in your browser. Nothing you enter is uploaded or stored.

Further reading: HEX, RGB and HSL Colour Codes, and Accessible Contrast.

Frequently asked questions

Which color formats can I paste?

HEX with 3, 4, 6 or 8 digits, rgb() and rgba(), hsl() and hsla(), hwb(), hsv() or hsb(), cmyk() and device-cmyk(), oklch(), oklab(), all 148 CSS color names, and plain numbers such as 36 83 230, which are read as RGB.

What is the difference between HSL and HSV?

Both describe a color by hue and saturation, but HSL uses lightness, where 50% is the pure color and 100% is white, while HSV uses value, where 100% is the brightest version of the color. HSV is common in design apps; HSL is the one CSS uses.

What is OKLCH?

A color format based on the OKLab model, with lightness, chroma and hue. It matches human perception better than HSL, so it is ideal for building consistent color scales, and it can describe colors beyond the sRGB range of older screens.

Is the CMYK value exact?

It is the standard device-independent conversion. Real printing depends on the press, paper and ICC profile, so ask your printer for a proof, and remember that some bright screen colors cannot be printed exactly.

Why did my color change slightly after converting?

Formats such as HSL and CMYK are shown rounded to whole numbers, so converting back can land one step away in RGB. Use the HEX or RGB values as the exact reference when precision matters.

What does the gamut warning mean?

Some OKLCH and OKLab colors are more saturated than ordinary screens can show. The converter then displays the nearest color inside the sRGB range, which is what most browsers show on standard monitors.

Is anything uploaded?

No. All conversions are calculated by code running in this page on your own device. Nothing is sent to a server or stored. You can safely use it with unreleased brand colors.