Color Converter

Convert opaque colors between HEX, RGB, HSL, and OKLCH, preview the sRGB result, and check the WCAG contrast ratio against a background.

Input

Color values

Paste an opaque HEX, RGB, HSL, or OKLCH color. The format is detected automatically.

Result

Copy CSS-ready values or check the contrast of the color pair.

Enter a color to convert it to all four formats.

Runs in your browser. Nothing is uploaded.

Also known as: hex to rgb, hsl converter, oklch to hex, color contrast checker

How to use

  1. Paste an opaque HEX, RGB, HSL, or OKLCH value, or try a sample syntax.
  2. Review the preview and all four CSS formats. An sRGB warning identifies approximated values.
  3. Set a background color to check the contrast ratio and the two WCAG AA text thresholds.

Frequently asked questions

Does the color converter support transparency?

No. Use opaque colors, including three- and six-digit HEX codes. Contrast for transparent colors depends on what lies behind them.

Why can an OKLCH color look different in HEX?

Some OKLCH colors cannot be represented in sRGB. The tool clips channels for HEX, RGB, and HSL while keeping the authored OKLCH coordinates.

What contrast ratio meets WCAG AA for text?

Regular text needs at least 4.5:1; large text needs at least 3:1. The tool compares the unrounded value with both thresholds.

Why do HEX and RGB sometimes round-trip differently?

HEX stores each channel as an integer from 0 to 255. RGB can represent fractional channels, so converting through HEX can introduce rounding.