Contrast Checker
Check WCAG 2.2 contrast for text and background colors in light and dark mode at once, get a passing color when a pair fails and copy it as light-dark().
Light mode
7.10:1
Large text reads at 3:1.
Body text at 14 to 16px needs 4.5:1 to pass WCAG AA.
Icons and borders need 3:1.
Normal text AA
1.4.3
Large text AA
1.4.3, 24px or 18.66px bold
Interface parts AA
1.4.11, borders, icons, focus rings
Normal text AAA
1.4.6
Large text AAA
1.4.6
Dark mode
7.39:1
Large text reads at 3:1.
Body text at 14 to 16px needs 4.5:1 to pass WCAG AA.
Icons and borders need 3:1.
Normal text AA
1.4.3
Large text AA
1.4.3, 24px or 18.66px bold
Interface parts AA
1.4.11, borders, icons, focus rings
Normal text AAA
1.4.6
Large text AAA
1.4.6
Copy as CSS
styles.css
/* light-dark() picks a side from color-scheme */:root { color-scheme: light dark;}
.card { color: light-dark(#6d28d9, #a78bfa); background-color: light-dark(#ffffff, #030712);}Free, runs in your browser, and nothing you enter leaves it. Read the idea behind it in Checking color contrast in light and dark mode.