CONTRAST RATIO CALCULATOR
Check the WCAG contrast ratio between two colors, with pass/fail results for AA and AAA. Nothing leaves your browser.
In short
Enter a foreground and background color and get the WCAG contrast ratio, with pass/fail results for AA and AAA at normal and large text sizes, plus a live text preview. Runs entirely in your browser.
13.96:1
The quick brown fox jumps over the lazy dog.
Sample text at this contrast ratio.
| Level | Result |
|---|---|
| AA — Normal text (4.5:1) | Pass |
| AA — Large text (3:1) | Pass |
| AAA — Normal text (7:1) | Pass |
| AAA — Large text (4.5:1) | Pass |
How to check contrast ratio
- 1
Pick or type a foreground (text) color and a background color as hex codes.
- 2
Read the contrast ratio and the live text preview.
- 3
Check the pass/fail table for WCAG AA and AAA at normal and large text sizes.
Questions
- How is the contrast ratio calculated?
- It follows the WCAG 2.x formula: each color's relative luminance is computed from its sRGB channels, then the ratio is (L1 + 0.05) / (L2 + 0.05), where L1 is the lighter color's luminance and L2 is the darker one's. The result ranges from 1:1 (identical colors) to 21:1 (black on white).
- What's the difference between AA and AAA?
- WCAG AA is the standard minimum accessibility level most sites target: 4.5:1 for normal text and 3:1 for large text (18pt+, or 14pt+ bold). AAA is a stricter, enhanced level: 7:1 for normal text and 4.5:1 for large text.
- What counts as 'large text' for these thresholds?
- WCAG defines large text as at least 18pt (24px) regular weight, or at least 14pt (18.66px) bold. Large text gets a lower contrast requirement because bigger, bolder glyphs remain legible at lower contrast.
- Is my color data sent anywhere?
- No. The luminance and ratio calculations happen entirely in your browser using JavaScript — nothing is uploaded or stored.
Related tools
- Bold-Start ReaderConvert pasted text or a PDF, EPUB, FB2, DOCX, TXT, Markdown or HTML file to bionic-style reading (the start of each word in bold), then read it online or download it as PDF, EPUB, FB2, DOCX or HTML — in the browser, no upload; an independent tool, not the official Bionic Reading® app.
- Leap Year CalculatorCheck if a year is a leap year and why, plus the next five leap years.
- Days Until CalculatorSee how many days, weeks, and months until (or since) a date.
- BMR CalculatorCalculate Basal Metabolic Rate and TDEE with the Mifflin-St Jeor formula.
- Discount CalculatorFind the final price and total savings from one or two stacked discounts.
- Percentage CalculatorFind X% of Y, what percent X is of Y, or the change between two numbers.
- Sales Tax CalculatorAdd sales tax to a price, or extract it from a tax-included total.
- Business Days CalculatorCount working days between two dates, or add/subtract business days from a date, with optional holidays to exclude.
Updated