WCAG Contrast Ratio Formula:
Where L is relative luminance (L1 is the lighter color, L2 is the darker color)
From: | To: |
The WCAG (Web Content Accessibility Guidelines) color contrast ratio measures the difference in perceived brightness between two colors. It's crucial for ensuring text is readable against its background for people with visual impairments.
The calculator uses the WCAG contrast ratio formula:
Where:
Explanation: The formula accounts for human perception of brightness, with higher ratios indicating better contrast.
Details: Proper color contrast is essential for accessibility, ensuring content is readable by people with color vision deficiencies or low vision.
Tips: Enter valid hex color codes (with or without #). The calculator will automatically determine which color is lighter and calculate the ratio accordingly.
Q1: What are the WCAG contrast requirements?
A: AA requires 4.5:1 for normal text (3:1 for large text), AAA requires 7:1 for normal text (4.5:1 for large text).
Q2: What is considered large text?
A: 18pt (24px) or larger, or 14pt (18.67px) bold or larger.
Q3: How is relative luminance calculated?
A: It's calculated using the sRGB color space with gamma correction, weighted for human perception of different color channels.
Q4: Does this apply to all interface elements?
A: Contrast requirements apply to text and essential graphical elements that convey information.
Q5: Are there exceptions to the requirements?
A: Logos, decorative elements, and inactive UI components may be exempt from contrast requirements.