The Color Contrast Ratio Calculator computes the WCAG 2.1 contrast ratio between any two colors and tells you exactly which accessibility levels (AA, AAA) you pass or fail for normal text, large text, and UI components. Built for frontend developers, designers, and accessibility auditors who need to verify color combinations meet WCAG standards before shipping.
Colors
Content
Design
Layout
1. Enter your foreground (text) color and background color using the color pickers or hex inputs. 2. Adjust the display card settings — choose a theme, font size variant, and border radius to match your design system. 3. Preview the live contrast ratio result with pass/fail badges for WCAG AA and AAA compliance levels. 4. Copy the generated Bootstrap 5 HTML snippet to embed the result card directly into your documentation or style guide.
Manually calculating WCAG contrast ratios using the relative luminance formula is tedious and error-prone — this tool does it instantly with no third-party dependencies, no browser extensions, and no sign-up. You get production-ready Bootstrap 5 HTML output you can drop straight into a design system doc, accessibility report, or component library, saving 20–30 minutes per color pair audit.