APCA Contrast Calculator

Enter a text and background hex color to compute the APCA Lc contrast.

How it is calculated

Each colour is converted to relative luminance Y = 0.2126729 R2.4 + 0.7151522 G2.4 + 0.0721750 B2.4 with R, G, B scaled to 0 to 1; very dark values are softly clamped. If the background is lighter than the text (dark text), Lc = ((Ybg0.56 − Ytxt0.57) × 1.14 − 0.027) × 100. If the text is lighter, it uses exponents 0.65 and 0.62 and the result is negative. Colours may be given as 3 or 6 hex digits, with or without #. The tool prints the signed Lc and its absolute value. It returns one score only: it does not look up minimum Lc values for font size or weight, so you compare the number with an APCA table yourself. Differences below a tiny luminance gap return 0.

Worked example

Take mid-grey text #767676 on a white background. Each channel is 118/255 = 0.4627, raised to 2.4, so the luminance is Y = 0.1573; white is 1.0. Dark text on light: (10.56 − 0.15730.57) × 1.14 = (1 − 0.3485) × 1.14 = 0.7427. Subtract the 0.027 offset: 0.7157, times 100 gives 71.6 Lc. Swapping the colours (white on #767676) gives −77.0 Lc, a larger magnitude, because APCA treats light-on-dark differently.

Try this example →

Common mistakes

  • Comparing an Lc value with the WCAG 2 ratio thresholds such as 4.5:1: they are different scales, and 71.6 Lc is not a ratio.
  • Ignoring the sign: a negative Lc just means light text on a dark background; judge it by its absolute value.
  • Assuming swapping text and background gives the same score: the two polarities are calculated differently, so the numbers differ.
  • Using one Lc pass mark for all text: small or thin text needs a much higher Lc than large bold text, and this tool does not give those thresholds.
  • Typing a colour name such as red or an rgb() value: only hex codes work, and anything else returns no result.

About this calculator

The APCA (Accessible Perceptual Contrast Algorithm) is a next-generation contrast metric being developed for WCAG 3, designed to replace the older WCAG 2.x contrast ratio formula, which is known to over- and under-estimate perceived readability for many color combinations. Instead of a simple luminance ratio, APCA accounts for text polarity (light-on-dark vs. dark-on-light), font weight, and font size, producing an Lc (Lightness Contrast) value roughly on a 0–106 scale that better matches how legible text actually looks to the human eye.

Because required Lc thresholds shift with font size and weight — small thin text needs a much higher Lc than large bold text to stay readable — APCA is paired with a font-size/weight lookup table rather than one fixed pass/fail number like WCAG 2's 4.5:1. Web accessibility auditors, UI designers, and design-system teams use APCA scores to choose text and background color pairs that will remain legible under the upcoming WCAG 3 guidelines, especially for typography sizes and weights the older ratio handled poorly.

Was this helpful?

You can pick up to 3 reactions.

Comments (0)

  • Be the first to comment.

Popular calculators

All Calculators