DevTools Hub

Color Converter & Contrast Checker

Convert between color formats, build a shade palette, and make sure your text is readable.

Pick or paste a color
HEX#3b82f6
RGBrgb(59, 130, 246)
HSLhsl(217, 91%, 60%)
HSVhsv(217, 76%, 96%)
CMYKcmyk(76%, 47%, 0%, 4%)

Shades (click to use)

Contrast checker (WCAG)

Large heading text

Normal body text looks like this. The quick brown fox jumps over the lazy dog.

3.68:1

contrast ratio

AA normal text (4.5:1)AA large text (3:1)AAA normal text (7:1)AAA large text (4.5:1)

Guide

About Color Formats and Contrast

Color formats explained

  • HEX (#3b82f6) writes red, green and blue as two hexadecimal digits each. It is the most common format in CSS and design tools.
  • RGB (rgb(59, 130, 246)) is the same information in decimal, 0 to 255 per channel.
  • HSL (hsl(217, 91%, 60%)) describes hue (0-360 degrees around the color wheel), saturation and lightness. It is the easiest format for making a color lighter, darker or more muted by hand.
  • HSV/HSB is similar to HSL and is used by most color pickers in design software.
  • CMYK approximates the cyan, magenta, yellow and black inks used in printing. Accurate print colors depend on the printer's color profile, so treat these values as a starting point.

Why contrast matters

Low-contrast text is hard to read for people with low vision or color blindness, and for everyone on a phone in bright sunlight. The Web Content Accessibility Guidelines (WCAG) define a contrast ratio from 1:1 (no contrast) to 21:1 (black on white) and set minimums:

  • AA: 4.5:1 for normal text and 3:1 for large text (about 24px, or 18.5px bold). This is the level most laws and policies require.
  • AAA: 7:1 for normal text and 4.5:1 for large text.

Tips for accessible palettes

  • Pick brand colors first, then use the shade strip to find a darker variant that passes AA for text.
  • Never rely on color alone to convey meaning; add icons or labels for errors and success states.
  • Check both light and dark themes, since a color that works on white often fails on dark gray.

Frequently asked questions

How is the contrast ratio calculated?

Using the WCAG 2 formula: each color's relative luminance is computed from its gamma-corrected RGB values, then the ratio is (lighter + 0.05) / (darker + 0.05).

Which input formats are accepted?

Three- or six-digit HEX (with or without #), rgb() and rgba(), and hsl() and hsla(), with commas or spaces.

Why does my color look different in print?

Screens mix light (RGB) while printers mix ink (CMYK), and many bright screen colors cannot be reproduced in ink. Ask your printer for a proof if exact color matters.