Color Converter and Contrast Checker
Type a color in any format (#1E90FF, rgb(30, 144, 255), hsl(210, 100%, 56%)…) or choose it with the picker, and you get the same color in HEX, RGB, RGBA, HSL, HSLA, HSV and CMYK, ready to copy. In “Check contrast” you compare a text color with its background and see right away whether it reads well under the WCAG 2.2 accessibility guidelines.
Works anywhere in the world, wherever you are.
HEX
#1E90FF
- Relative luminance
- 0.2744
- Contrast with white
- 3.23:1
- Contrast with black
- 6.48:1
- Text that reads best on it
- Black
The same color in every format
HEX
#1E90FFHEX8
#1E90FFFFRGB
rgb(30, 144, 255)RGBA
rgba(30, 144, 255, 1)HSL
hsl(210, 100%, 56%)HSLA
hsla(210, 100%, 56%, 1)HSV / HSB
hsv(210, 88%, 100%)CMYK
cmyk(88%, 44%, 0%, 0%)
CMYK here is the simple formula from RGB, not a print profile: what comes off a press depends on its inks, paper and ICC profile. For print work, convert the color in your design software or ask the printer.
W3C, Web Content Accessibility Guidelines (WCAG) 2.2: definitions of “relative luminance”, “contrast ratio” and “large scale (text)”, success criteria 1.4.3 (AA) and 1.4.6 (AAA). Reviewed November 2026. Everything is worked out in your browser. The colors are remembered on your device and go in the Share link; they are not sent to any server.
Related tools
About this calculator
How to use it
In “Convert a color”, type the color however you have it: HEX with 3, 4, 6 or 8 digits (with or without #), rgb() or rgba(), hsl() or hsla(), hsv() (also called HSB) or cmyk(). Commas, spaces and the CSS slash form for transparency all work, as in rgb(30 144 255 / 50%). You can also type three bare numbers, read as R, G and B. The small square on the right opens your browser's color picker.
Below you get the color in every format with a copy button, its relative luminance and its contrast with white and with black, which tells you at a glance whether light or dark text belongs on top of it.
In “Check contrast”, type or pick the text color and the background color. You see the contrast ratio, whether it passes AA and AAA for normal and large text, and a sample in your two colors. “Swap” flips text and background.
How contrast is calculated
It uses the W3C's WCAG 2.2 definitions. First, each color's relative luminance: every 0–255 channel is divided by 255 and turned into linear light (at 0.04045 or below it is divided by 12.92; otherwise ((value + 0.055) / 1.055) is raised to 2.4). Then L = 0.2126 × R + 0.7152 × G + 0.0722 × B. Green weighs most because the eye is most sensitive to it.
The contrast ratio is (L1 + 0.05) / (L2 + 0.05), where L1 is the luminance of the lighter color and L2 of the darker. It runs from 1:1 (two identical colors) to 21:1 (black on white).
Success criterion 1.4.3 (level AA) asks for at least 4.5:1 for normal text and 3:1 for large text. 1.4.6 (level AAA) asks for 7:1 and 4.5:1. Large text is at least 18 point, or 14 point bold.
The ratio is compared exactly, never rounded: 4.499 does not pass 4.5. That is why the tool shows the figure cut to two decimals, never rounded up.
Example
The blue #1E90FF is rgb(30, 144, 255), hsl(210, 100%, 56%), hsv(210, 88%, 100%) and, with the simple formula, cmyk(88%, 44%, 0%, 0%).
The grey #767676 has a relative luminance of 0.1812. On white (luminance 1) it gives (1 + 0.05) / (0.1812 + 0.05) = 4.54:1: it passes AA for normal and large text, and AAA for large text only. One step lighter, #777777, drops to 4.47:1 and no longer passes AA for normal text, though it still does for large text.
Black on white gives 21:1, the highest possible.
The color formats, briefly
HEX is the same RGB written in base 16: two digits per channel (00 to FF). With 8 digits, the last pair is the transparency. RGB gives the amount of red, green and blue from 0 to 255; RGBA adds transparency from 0 to 1.
HSL describes a color by hue (degrees around the color wheel), saturation and lightness, which makes it easy to lighten or darken a color. HSV (or HSB) uses hue, saturation and value, like many design-app pickers. HSL and HSV values are shown rounded, so typing them back can move the HEX by one step.
CMYK (cyan, magenta, yellow and black) is the printing model, but here it comes from the simple formula from RGB, with no print profile.
Important limitations
- This tool's CMYK is a formula, not a print profile. What comes off a press depends on its inks, paper and ICC profile; for print work, convert the color in your design software or ask the printer.
- Everything works in 8-bit-per-channel sRGB, the web's color space. Wide-gamut (Display P3) and other color spaces are not represented.
- Contrast is one WCAG requirement, not all of them: font size, typeface and weight also affect whether text reads well. WCAG is a W3C technical standard; this tool does not certify that a site complies with any law.
- Color names such as “blue” are not accepted: enter the HEX code or the values.
Frequently asked questions
This calculation runs in your browser and is never sent to a server. Your last values may be saved on your device only, for convenience. Results are estimates and are not financial, tax, accounting or legal advice.