MUTools

Other

Color Code Converter

Color Code Converter converts between HEX, RGB, HSL, HSV, and OKLCH. Enter a single color and the tool computes every supported format at once, listing each value so you can copy it with one click. From hex to rgb and rgb to hex to HSL and rgba, it covers the color conversions you reach for in web and design work.

Preview
1.00

Convert to all formats

FormatValueCopy
HEX#1E90FF
HEX8#1E90FFFF
RGBrgb(30, 144, 255)
RGBArgba(30, 144, 255, 1)
HSLhsl(210, 100%, 56%)
HSLAhsla(210, 100%, 56%, 1)
HSVhsv(210, 88%, 100%)
OKLCHoklch(0.652 0.19 253)
CMYKcmyk(88%, 44%, 0%, 0%)

CMYK is a reference value for print. Because it depends on the gamut and print profile, the tool shows an approximation calculated from screen sRGB. It is not accepted as an input format.

Every conversion runs in your browser, and the values you enter are never sent to any server.

About Color Code Converter

Color Code Converter converts between HEX, RGB, HSL, HSV, and OKLCH. Enter a single color and the tool computes every supported format at once, listing each value so you can copy it with one click. From hex to rgb and rgb to hex to HSL and rgba, it covers the color conversions you reach for in web and design work.

You do not need to pick the input format. Paste a 3- or 6-digit HEX like #1E90FF, a 4- or 8-digit HEX with alpha, rgb(30, 144, 255) or rgba(30 144 255 / 0.8), hsl(210, 100%, 56%) or hsla(...), hsv(...), or oklch(0.65 0.19 253), and the tool detects the format automatically. You can also pick a color from the native color picker, or use the alpha slider to set opacity anywhere from 0 to 1.

The output includes OKLCH, the perceptually uniform color space increasingly used in CSS, along with a CMYK reference value used in print. It is handy whenever you move between HEX, RGB, HSL, and HSV and need to hand the same color accurately between design comps, CSS, and design tools.

Every conversion runs in your browser, and the values you enter are never sent to any server. No account and no ad clicks required — just start converting. Runs entirely in your browser.

How to use

  1. Paste a color code into the input field (HEX, RGB, HSL, HSV, and OKLCH are detected automatically). You can also pick a color from the color picker on the right.
  2. To change transparency, set the opacity (0–1) with the alpha slider.
  3. Check the current color, including transparency, in the preview.
  4. In the "Convert to all formats" table, review the HEX, 8-digit HEX, RGB, RGBA, HSL, HSLA, HSV, OKLCH, and CMYK values.
  5. Use the "Copy" button on each row to copy the format you need.

Use cases

  • Web designers and coders converting a HEX from a design comp into CSS rgb() / rgba().
  • Front-end engineers specifying colors with alpha precisely as 8-digit HEX or rgba.
  • Users tuning hue, saturation, and lightness in HSL or HSV and grabbing the final HEX.
  • Designers building perceptually uniform palettes in OKLCH and checking the matching RGB / HEX.
  • Users gauging an on-screen color as a CMYK reference value for print.
  • Developers handing the same color between multiple tools and codebases in different formats.

Notes

  • HEX, RGB, HSL, HSV, and OKLCH are accepted as input formats. CMYK is print-oriented and depends on the gamut and profile, so it cannot be converted back uniquely from screen sRGB; it is therefore output only (a reference value).
  • Alpha is supported via 8-digit HEX (#RRGGBBAA), 4-digit HEX (#RGBA), rgba(), hsla(), and `oklch(L C H / a)`. You can also set transparency with the alpha slider.
  • The native color picker cannot handle transparency (6-digit HEX only), so the current alpha is preserved even when you pick a color with it.
  • HSL, HSV, CMYK, and OKLCH are rounded to integers or a fixed number of decimals for display, so a re-conversion may introduce a very small error.
  • When an OKLCH-to-RGB conversion falls outside the sRGB gamut, the result is clamped to the displayable range.

FAQ

Is the color I enter sent to a server?
No. Every conversion runs entirely in your browser, so you can safely use it with work colors or brand colors.
What is the formula for converting hex to rgb?
In a 6-digit HEX, each pair of digits is the hexadecimal value for R, G, and B. Converting each pair to decimal gives a value from 0 to 255 (for example, 1E→30, 90→144, FF→255, so #1E90FF = rgb(30, 144, 255)). The tool computes this for you automatically and also handles the reverse direction (rgb to hex).
Can it convert 8-digit color codes?
Yes. The last two digits of an 8-digit HEX (#RRGGBBAA) represent the alpha (transparency). When you paste one, the tool converts it with the alpha included, and you can also read it as RGBA or HSLA.
Does it support converting to HSL and HSV?
Yes. When you enter a color, it shows both HSL (hue, saturation, lightness) and HSV (hue, saturation, value) at the same time. You can also paste an hsl() or hsv() string to convert it to other formats.
What is OKLCH?
OKLCH is a perceptually uniform color space that describes a color by lightness (L), chroma (C), and hue (H). It is well suited to intuitive adjustments, such as changing the hue while keeping the lightness constant, and is increasingly used in modern CSS. This tool converts between OKLCH and sRGB in both directions.
Can I enter CMYK?
CMYK is output only (a reference value). It is a print-oriented color space that depends on the ink, paper, and print profile, so it cannot be converted back uniquely from screen sRGB. The tool therefore shows a CMYK value calculated from the on-screen color as a rough guide and does not accept it as an input format.