Skip to content
Calculator Tools
CSS & Design Calculators

Contrast Ratio Calculator

WCAG contrast ratio between two colours, with AA and AAA pass or fail for each text size.

Enter values

Results update as you type.

Result

Contrast ratio

14.68 : 1

Large text means 18.66px bold or 24px regular and above.

Normal text AA (4.5:1)
Pass
Normal text AAA (7:1)
Pass
Large text AA (3:1)
Pass
Large text AAA (4.5:1)
Pass
UI components (3:1)
Pass
Overall
Excellent — passes every level

About the Contrast Ratio Calculator

The WCAG contrast ratio compares the relative luminance of two colours on a scale from 1:1 to 21:1. Normal-size text needs 4.5:1 to pass AA and 7:1 for AAA; large text gets a lower bar. This calculator gives the ratio and tells you exactly which levels the pair passes.

Also known as: wcag contrast checker, color contrast calculator, accessibility contrast, text contrast ratio.

How to use this calculator

  1. Enter foreground (text) colour, background colour.
  2. The result updates instantly as you type — press Calculate (or Enter) at any time.
  3. Review the breakdown shown under the main result.
  4. Use Copy result or Share to save the answer or send a link with your inputs.

Formula

ratio = (L_lighter + 0.05) ÷ (L_darker + 0.05)

Worked example

Using the values pre-filled in the calculator above:

  • Foreground (text) colour: #1F2937
  • Background colour: #FFFFFF

the calculator returns:

  • Contrast ratio: 14.68 : 1
  • Normal text AA (4.5:1): Pass
  • Normal text AAA (7:1): Pass
  • Large text AA (3:1): Pass

Frequently asked questions

What contrast ratio do I need?

4.5:1 for body text and 3:1 for large text or UI controls to meet WCAG AA, which is the level most accessibility regulations reference.

Does the ratio change if I swap the colours?

No — it is symmetrical. Only which one is lighter changes.