Practical Guide

Color Contrast Calculator โ€” Usage Guide and Technical Principles

Check WCAG 2.2 contrast for normal text, large text, and essential graphics. Preview solid or transparent HEX colors before using them.

Open tool

Overview

It compares the relative luminance of two colors. Check the actual text and background colors together when choosing accessible combinations.

Key concepts

Relative luminance

The calculation composites the colors before converting sRGB to linear light. Pass or fail uses the full ratio before display rounding.

CSS HEX notation

Four- and eight-digit HEX notation places opacity in the final digit or pair.

Features

HEX with alpha

Check short or long HEX values and layer transparent colors over white.

WCAG 2.2 results

Compare the ratio with AA and AAA text thresholds and the AA threshold for essential graphics.

Live preview

Read a heading and sample paragraph using the colors you entered.

Use Cases

Design tokens

Compare text and surface token pairs before adding them to a design system.

Interface states

Check icon or outline contrast against adjacent colors in a chosen button or input state.

Frequently Asked Questions

What counts as large text?

WCAG generally uses at least 18 pt (24 CSS px) at regular weight or 14 pt (about 18.67 CSS px) in bold.

How do I test text on a photo or gradient?

Check the colors immediately behind the text, including the area with the weakest contrast. This tool evaluates one color pair at a time.

Related Documents

Color Contrast Calculator

Open the tool to try these features.

Open tool