What is a good color contrast ratio?
WCAG AA asks for at least 4.5:1 for normal text and 3:1 for large text. The ratio describes a difference in relative luminance, from 1:1 for identical luminance to 21:1 for black against white. It accounts for how much red, green and blue contribute to brightness, rather than simply comparing their hex numbers. W3C explains the thresholds in its text contrast guidance.
A result just below a threshold fails, even when rounding would appear to reach it. This tool cuts the displayed ratio to two decimal places and uses the full calculation to decide Pass or Fail. Text with transparency is first blended over your solid background. A photograph, gradient or layered background needs checks at the actual locations behind the text.