# Contrast ratio

*noun*

say it: **“KON-trast RAY-shee-oh”** **/ˈkɒntræst ˈreɪʃioʊ/**

A number that says how different in lightness a text color is from its background, from 1 to 1 (the same color) up to 21 to 1 (black on white).

## What is a **contrast ratio**?

A **contrast ratio** compares how light a text color is with the color behind it, from 1 to 1 (the same color) up to 21 to 1 (black on white). Body text needs at least 4.5 to 1 so everyone can read it, and large text at least 3 to 1. The browser's developer tools show the ratio in their color picker.

```css
.opening-hours { color: #767676; background: white; }   /* 4.54 to 1: just passes */
```

## In a sentence

- “Light gray on white looked stylish, but its **contrast ratio** was only 2.3 to 1, too faint for body text.”

Level: Apprentice · [More CSS terms at this level](https://www.ask-codey.com/glossary?category=css&level=2)

Updated: November 9, 2026

Source: https://www.ask-codey.com/glossary/contrast-ratio
