Color Contrast Checker Calculator

Test foreground and background colors for readability quickly. See WCAG grades, ratios, and luminance details. Export results, compare palettes, and meet accessibility targets today.


Calculator

Enter #RGB or #RRGGBB.
Use the page background if unsure.
Used to decide normal vs large text thresholds.
Bold changes the large text rule.
Shown in the preview using your selected colors.
Reset

Formula used

This calculator uses WCAG relative luminance and contrast ratio:

  • L = 0.2126·R + 0.7152·G + 0.0722·B (linearized sRGB)
  • Contrast = (L1 + 0.05) / (L2 + 0.05) where L1 ≥ L2

Linearization converts sRGB to light intensity using the WCAG piecewise transform before computing luminance.

How to use

  1. Pick or paste your foreground and background colors.
  2. Set font size and weight to match your UI text.
  3. Click Check contrast to see the ratio and grades.
  4. Adjust colors until AA or AAA passes as needed.
  5. Download CSV or PDF to share with your team.

Example data table

Foreground Background Contrast Ratio AA Normal AAA Normal
#111827#ffffff17.74PassPass
#6b7280#ffffff4.83PassFail
#ffffff#0f172a17.85PassPass
#0ea5e9#082f495.01PassFail
#22c55e#052e166.54PassFail
These examples are illustrative. Always verify your exact UI colors and typography.

Contrast risks in analytics UI

Analytics screens pack tables, charts, and tiny labels into limited space, so weak contrast quickly turns into missed actionable signals. When axis ticks fade, users misread trends and spend longer scanning for context. In operational dashboards, slower recognition can delay alerts, increasing incident cost. Strong contrast improves legibility for low vision, aging eyes, and bright-room viewing. Consistent contrast also reduces cognitive load during repeated comparison tasks.

How the calculator computes luminance

The tool converts each channel from sRGB into linear light before combining them into relative luminance. Green receives the largest weight because human perception is most sensitive there. After luminance is calculated for both colors, the contrast ratio is computed as (L1 + 0.05) / (L2 + 0.05). The 0.05 term prevents division extremes and models low-light perception. This approach compares perceived brightness rather than raw RGB values.

Reading AA and AAA results

Results map the ratio to common WCAG targets so teams can decide the right bar for each component. For normal text, AA needs 4.5:1 and AAA needs 7:1, which usually covers body copy and dense tables. Large text uses lower thresholds because thicker strokes remain readable at smaller ratios. Always consider the smallest font in the component, not just the headline. Use higher targets for controls that gate navigation, like filters.

Building palette rules at scale

Start with stable neutrals for surfaces, then define accessible text colors for primary, secondary, and disabled states. If a brand hue fails on white, shift its lightness for text or restrict it to accents and data marks. Verify hover, selected, and error backgrounds, because state overlays often reduce contrast unexpectedly. Document approved pairs as tokens so future screens inherit compliant defaults. In charts, keep gridlines subtle yet still distinguishable from canvas.

Making checks part of delivery

Treat contrast as a measurable requirement during design reviews, implementation, and QA, not a last-minute audit. Store your chosen pairs with component names, target ratios, and example sizes. Export reports for stakeholders and keep exceptions time-boxed with owners. When data visualization libraries change themes, re-check contrast to avoid regressions across releases. Schedule reviews for new product areas and templates.

FAQs

1) What contrast ratio should I target?

Use AA as the minimum for standard text, and prefer AAA for tables, filters, and critical KPIs when practical, especially on light surfaces.

2) Does font size affect pass or fail?

Yes. Large text has lower required ratios. This page shows both grades and highlights the recommended check based on your size and weight.

3) Why do colors look different on devices?

Displays vary by calibration, brightness, and ambient light. Rely on the numeric ratio for consistency, then spot-check on representative screens.

4) Can I use this for icons and chart strokes?

Yes, but thin strokes often need higher contrast. Aim for AAA when possible and avoid very light tints on white or light gray backgrounds.

5) What is relative luminance?

It is a brightness value calculated from linearized red, green, and blue components, weighted to reflect human visual sensitivity.

6) What if my brand color fails?

Adjust lightness for text, reserve the hue for accents, or pair it with an accessible text color. Save approved pairs as reusable design tokens.


Related Calculators

Chart Selection ToolDashboard KPI BuilderData Story GeneratorVisualization ROI CalculatorChart Readability ScoreDashboard Load TimeEngagement Rate EstimatorData Density CalculatorLabel Overlap CheckerVisual Clutter Score

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.