Color Converter

Enter a color as HEX, RGB, HSL, HSV or CMYK and get every other format, its WCAG relative luminance, and its contrast ratio against white and black.

HEX#1E90FF

3 or 6 hex digits, with or without #.

HEX

#1E90FF

  • RGBrgb(30, 144, 255)
  • Relative luminance (WCAG)0.2744
  • Contrast vs white3.24:1 — AA large text only
  • Contrast vs black6.49:1 — AA (all text), AAA large text
  • More readable text on itBlack
Color in every format
FormatValue
HEX#1E90FF
RGBrgb(30, 144, 255)
HSLhsl(209.6, 100%, 55.9%)
HSV / HSBhsv(209.6, 88.2%, 100%)
CMYK (naive)cmyk(88.2%, 43.5%, 0%, 0%)
Contrast vs white3.24:1
Contrast vs black6.49:1

RGB, HEX, HSL and HSV assume sRGB. CMYK uses the simple device-independent formula; real print values depend on the printer's ICC color profile, ink and paper. WCAG requires 4.5:1 for normal text and 3:1 for large text at level AA (7:1 and 4.5:1 at AAA).

How this was calculated

RGB = (30, 144, 255) → HEX #1E90FF.

Linearize each channel c = v ÷ 255 (c ≤ 0.04045 ? c ÷ 12.92 : ((c + 0.055) ÷ 1.055)^2.4), then L = 0.2126 R + 0.7152 G + 0.0722 B = 0.2744253699.

Contrast vs white = (1 + 0.05) ÷ (0.2744253699 + 0.05) = 3.236491648; vs black = (0.2744253699 + 0.05) ÷ 0.05 = 6.488507398.

How the formats relate

HEX is RGB written in base 16: #1E90FF means red 0x1E = 30, green 0x90 = 144 and blue 0xFF = 255. HSL and HSV describe the same sRGB color by hue (0–360°), saturation and lightness or value, using the formulas in CSS Color Level 4.

For #1E90FF the largest channel is blue, so hue = 60 × ((R − G) ÷ (max − min) + 4) = 60 × ((30 − 144) ÷ 225 + 4) = 209.6°. Lightness is (max + min) ÷ 2 = 55.9%, giving hsl(209.6, 100%, 55.9%) and hsv(209.6, 88.2%, 100%).

CMYK is an approximation

The CMYK shown uses the simple formula K = 1 − max(R′, G′, B′) and C = (1 − R′ − K) ÷ (1 − K), with M and Y the same way, which gives cmyk(88.2%, 43.5%, 0%, 0%) for #1E90FF. Real print values depend on the printer's ICC color profile, inks and paper, so use your print shop's profile for final artwork.

WCAG contrast ratio

WCAG 2.2 defines relative luminance by linearizing each sRGB channel (c ≤ 0.04045 ? c ÷ 12.92 : ((c + 0.055) ÷ 1.055)^2.4) and weighting them L = 0.2126 R + 0.7152 G + 0.0722 B. Contrast is (L_lighter + 0.05) ÷ (L_darker + 0.05), from 1:1 up to 21:1 for black on white.

#1E90FF has L = 0.2744, so it reaches 3.24:1 with white text (large text only at AA) and 6.49:1 with black text.

To test your own pair, set Contrast check to your own text color and enter it as HEX or rgb(). The color entered above is treated as the background. Dark navy #1A2B3C text on #1E90FF, for example, has L = 0.0227 and gives (0.2744 + 0.05) ÷ (0.0227 + 0.05) ≈ 4.46:1: it passes AA for large text but fails AA for normal text. The ratio is compared without rounding, so 4.49:1 does not count as 4.5:1.

WCAG 2.2 text contrast minimums
LevelNormal textLarge text
AA4.5:13:1
AAA7:14.5:1

How to use the Color Converter

Pick the format you have and enter the color.

  1. Choose the input format

    Select HEX, RGB, HSL, HSV/HSB or CMYK.

  2. Enter the color

    Type the hex code or the channel values.

  3. Read the formats

    See the color in every format with WCAG contrast against white and black.

References

Frequently asked questions

How do I convert HEX to RGB?

Split the six digits into three pairs and convert each from base 16: #1E90FF is 1E = 30, 90 = 144, FF = 255, so rgb(30, 144, 255). Three-digit codes double each digit, so #ABC is #AABBCC.

What contrast ratio do I need for text?

WCAG 2.2 level AA needs at least 4.5:1 for normal text and 3:1 for large text (about 24 px, or 19 px bold). Level AAA needs 7:1 and 4.5:1.

Why does my printed color look different?

Screens mix light in RGB while printers mix inks in CMYK, and each printer has its own profile. The CMYK here is a device-independent estimate, not a print-ready value.

Last updated . Results are estimates for informational purposes only.