Contrast and color
The decisions that make it readable

Contrast you can measure, and color that never carries the message alone

Measure the contrast between your text and its background against a published threshold, carry nothing by color alone, and know exactly where the published ratio stops telling you anything.

Start here Essentials

This is the one decision in the manual you can put a number on. Four steps, and the last one needs a printer set to grayscale and about a minute.

  1. Put your text color and your background color into a contrast checker. The hex values from your own piece, not ones that look similar (what a ratio is).
  2. Get body text to 4.5:1 or better and large text to 3:1 or better. Do not round up (the thresholds).
  3. Find anything told apart by color alone and add a word, a shape or a position to it. (nothing by color alone).
  4. Print it in black and white and see what still carries. (the black-and-white print).

Minimum time: about 20 minutes, plus one grayscale print. Done when: every text color on the piece meets its threshold, and a black-and-white print still carries every piece of information the color version does.

1. What a contrast ratio is, and what it measures Understand

A contrast ratio is a single number describing how far apart two colors are in lightness, calculated from their red, green and blue values. It runs from 1:1, two identical colors, to 21:1, black against white. Definition

The arithmetic is published in WCAG 2.1. Each of the three channels is converted from its sRGB value to a linear value, the three are weighted and added together to give a relative luminance, with green weighted far more heavily than red and red more than blue, and the ratio is the lighter luminance plus 0.05, divided by the darker plus 0.05. Physical principle The green weighting is why a mid-green and a mid-red of apparently similar intensity can be miles apart in contrast, and why eyeballing it fails.

Two consequences worth holding on to:

  • Swapping the text and the background does not change the ratio. Dark on light and light on dark measure the same. Which one you choose is a decision about glare, ink and the room, not about the number.
  • The number is about lightness, not about hue. Two colors can be violently different and measure 2:1. Red text on a dark blue background is a classic example, and we measure it below.

Contrast ratio does this arithmetic from two hex values. If you would rather use somebody else's, WebAIM's checker is the one most widely used and it is free.

2. The thresholds, and what counts as large text

WhatThresholdLevelPublished by
Text and images of text4.5:1AAWCAG 2.1 SC 1.4.3
Large-scale text3:1AAWCAG 2.1 SC 1.4.3
Text, enhanced7:1AAAWCAG 2.1 SC 1.4.6
Large-scale text, enhanced4.5:1AAAWCAG 2.1 SC 1.4.6
Parts of a graphic you need in order to understand it3:1AAWCAG 2.1 SC 1.4.11

Large scale means at least 18 point, or 14 point bold. Definition The W3C's page gives 1 point as about 1.333 px, which puts those at roughly 24 px and about 18.5 px. WebAIM, restating the same criterion, describes bold as a font-weight of bold, or 700 or greater.

Do not round up. The W3C's own explanation says 4.499:1 does not meet the 4.5:1 threshold. WebAIM makes the same point with a worked example: a mid-gray that comes out at 4.47:1 against white fails. Contrast ratio shows two decimals and does not round them up.

What the criterion exempts. WCAG lists incidental text, meaning inactive components, pure decoration, text not visible to anyone, and text that is part of a picture with significant other visual content; and logotypes, meaning text that is part of a logo or brand name. Regulation A logo that fails is exempt. The event name set in the same color beside it is not.

The rationale the W3C gives for the two numbers is worth knowing because it tells you what they are for: 3:1 is described as the minimum level recommended for text and normal vision, and 4.5:1 is set to compensate for roughly 20/40 acuity, which is about what a person loses in ordinary aging. The 7:1 level compensates for roughly 20/80.

3. Pairs, measured

Here are seven pairs with their measured ratios. The chips are decoration; each caption states the two colors and the number, so nothing here depends on seeing the chip.

  • SATURDAY 8 AM16.02:1
    Near-black #1e2225 on white #ffffff. Passes 4.5:1, 3:1 and 7:1.
  • SATURDAY 8 AM4.54:1
    Gray #767676 on white. Passes 4.5:1 by four hundredths. Any lighter gray fails.
  • SATURDAY 8 AM3.03:1
    Gray #949494 on white. Fails 4.5:1. Passes 3:1, so it is allowed at 18 pt or 14 pt bold and above, and not below.
  • SATURDAY 8 AM1.61:1
    Yellow #f2c744 on white. Fails everything. Yellow is a light color, and a light color on white has nowhere to go.
  • SATURDAY 8 AM9.93:1
    The same yellow, used as the background with near-black text. Passes everything. Same two colors, opposite job.
  • SATURDAY 8 AM2.01:1
    Red #c0392b on dark blue #2c3e50. Two colors that could not be more different in hue and are close in lightness. Fails everything.
  • SATURDAY 8 AM10.50:1
    White on indigo #353a72. Passes everything. Light on dark measures exactly the same as dark on light.

Two lessons sit in that set. The fourth and fifth chips are the same two colors with their jobs swapped, from a total failure to a comfortable pass, which is the cheapest fix available when a brand color is fixed for you. And the sixth is the case the eye gets wrong: a red and a blue feel like maximum contrast and measure 2:1, because contrast is about lightness and those two are nearly the same lightness.

Limits

A reader will over-read a passing ratio into "this is readable". The WCAG ratio is calculated on two flat colors on a screen. It knows nothing about a hairline typeface, glare on a laminated sign, ink spreading on cheap paper, the light in the room, or how far away the reader is standing. WebAIM says plainly that WCAG gives no guidance for gradients, semi-transparent colors or background images. It is a floor you can check, not a verdict. A piece can pass at 7:1 and be unreadable, and the test that finds that is still the walk-back in What gets read first.

4. Nothing carried by color alone

WCAG's use-of-color criterion, SC 1.4.1, asks that color not be the only visual means of conveying information, indicating an action, prompting a response or distinguishing an element. Regulation It is a Level A criterion, the lowest bar there is, and it is the one most ordinary pieces break.

What breaking it looks like on a flyer:

  • Sold-out sessions printed in gray and available ones in black, with nothing else to tell them apart.
  • A map where the red route is the walking one and the blue is the driving one, labeled only in a color key.
  • A schedule where the children's events are green.
  • "Fill in the fields marked in red."
  • A chart where two bars are told apart by their fill color and nothing else.

The fix is additive and cheap: add a word, a shape, a pattern, a position or a label. "Sold out" beside the line. The walking route drawn dashed and the driving route solid. A small icon beside the children's events. "Fill in the required fields, marked with an asterisk."

One useful detail from the criterion: a color difference that also gives at least 3:1 luminance contrast counts as an additional visual distinction, because then it is not hue alone doing the work. Two colors that differ only in hue still need a second indicator.

WCAG also sets a 3:1 floor for the parts of a graphical object you need in order to understand it, under SC 1.4.11. Definition That is the criterion that covers the lines of a diagram, the segments of a chart and the border of a box you have to be able to see, and it exempts graphics whose particular presentation is essential, which it illustrates with logos, flags, photographs and heat maps.

5. The black-and-white print

This is the whole chapter in one test, and it costs one sheet of paper.

Print the piece with the printer set to grayscale or black and white. Then read it and ask: is every piece of information still here?

Test it Three things show up that nothing else finds:

  • Information carried by color alone collapses into two shades of the same gray, and you see it immediately.
  • Low-contrast pairs that looked acceptable in color turn out to have been relying on the hue difference. A gold on cream that read as legible becomes one flat tone.
  • A photograph with text over it reveals where the text is sitting on the light part, which is usually where the formula could not help you anyway.

And it is not an artificial test. A flyer gets photocopied by somebody who wants ten more. A notice gets faxed, scanned, printed on an office machine that is out of one cartridge. A PDF goes to a reader who prints everything in grayscale to save toner. The grayscale version is a real version of your piece, and often the one with the widest circulation.

6. Where the number stops knowing anything

A list, because this is the part most advice about contrast leaves out.

SituationWhat the ratio knowsWhat settles it
Two flat colors on a screenEverything it claims toThe number
A gradient, a transparency, text on a background imageNothing; WebAIM says WCAG gives no guidanceTesting the area of lowest contrast, or taking the text off the image
A hairline or very light typefaceNothing; the formula has no input for stroke weightPrinting it and looking from the distance
Ink on uncoated or recycled paperNothing; ink spreads and the paper is not whiteA test print on the real stock
Glare on a laminated or glossy signNothingStanding where a reader stands, at the time of day they will be there
A projector in a lit roomNothing; the room's light is added to your blackChecking the deck on the room's projector with the lights as they will be
Reading distanceNothingLetter height from distance

That is not an argument against measuring. It is an argument for measuring and then looking, which is the shape of every test in this manual.

Text over a photograph Go deeper

The common case where the formula gives no answer. WebAIM's own guidance is to test the area of lowest contrast, which means finding the lightest patch of the photograph under your light text and measuring against that. It also notes two things that help: a text outline color can serve as the text color for the purposes of measurement, and a glow or halo behind the text can serve as the background.

Four approaches, roughly in order of how reliable they are:

  1. Put the text somewhere else. A solid band above or below the picture gives you two flat colors and a number you can trust. This is the answer most of the time and it looks fine.
  2. Put a solid panel behind the text, over the photograph. Same benefit, and the picture still reads behind it.
  3. Darken the whole picture under the text with a flat overlay, then measure against the darkest-case result. A flat overlay is measurable; a gradient overlay is not.
  4. Measure the worst patch and accept it. Only if the photograph is genuinely uniform where the text sits, and only after a grayscale print.

What to avoid is text sitting directly on a busy photograph with a thin drop shadow. The shadow does not produce a measurable background, the busy areas break the letterforms up, and the piece fails in a way nobody can point at.

Color vision, and the figures people quote Go deeper

Two prevalence figures circulate, and it is worth being precise about who says each one.

The National Eye Institute's page on color blindness says, in its own words, that about 1 in 12 men have color vision deficiency, and that men have a much higher risk than women. It gives no figure for women and none for the general population. Test it The most common type, it says, makes it hard to tell the difference between red and green.

Section508.gov, a GSA site, states approximately 1 in 12 men and approximately 1 in 200 women, and attributes the figures to the National Eye Institute. The 1-in-200 figure is not on the NEI page this manual read, so the honest citation for it is Section508.gov rather than NEI. Definition

Neither figure changes what you do, which is the point of nothing carried by color alone. What they do is tell you the size of the audience that criterion is for, and the answer is large enough that a flyer handed to a room of forty people is likely to be read by somebody it applies to.

Section508.gov's page is the most useful thing this manual found for seeing the effect rather than reading about it: it carries worked before-and-after images of a low-contrast and a high-contrast menu, shown under typical vision, under color blindness and under low vision. Looking at the same menu three ways makes the argument faster than a paragraph does.

Signs: a different rule in kind Go deeper

Caution

Where the Americans with Disabilities Act applies to a building or facility, its sign requirements are legal requirements and are not satisfied by following this manual. The passage below quotes the 2010 Standards so you can read them; it certifies nothing. Ask a code official.

The ADA's requirement for visual characters on signs in its scope is not a ratio. Section 703.5.1 asks for a non-glare finish, and for light characters on a dark background or dark characters on a light background. Regulation That is a rule about finish and about polarity, and it is interesting partly because it is what a standards body wrote when it had to cover a physical object in a real room rather than a screen.

Two practical consequences for any sign, in scope or not:

  • Laminating can make a sign worse. A gloss laminate adds a specular reflection, and a reader standing in the wrong place sees the ceiling light instead of the text. Matte laminate avoids most of it. The standard's non-glare requirement exists because this is a real failure, and it is one the contrast formula cannot see.
  • Pick a polarity and keep it. Light on dark and dark on light measure the same, so choose by the conditions: dark on light tends to survive a dirty or sun-faded surface better, light on dark tends to hold up at night under a streetlight. Then use the same polarity across a set of signs, so that a reader learns what your signs look like.

The sizing of the characters, which is the other half of a readable sign, is in Signs.

7. See it: a yard sign and a lobby screen See it

Fictional example

Wendell Halvorsen's driveway sale signs. Three signs on 12 by 18 inch posterboard, printed at home on 8.5 by 11 inch paper and taped to board. Read from a car at about twenty-five miles an hour with roughly sixty feet of warning.

Known. He has a yellow posterboard and a black marker, and he was going to print the word SALE in his printer's yellow on white because the board is yellow.

Assumed. That yellow reads as high contrast because it is a bright color. Wendell's assumption, and it is the commonest contrast mistake there is.

Open. How the sign looks in late-afternoon sun from the west, which is when the sale traffic will arrive. Settled by: standing at the corner at four o'clock and looking.

What the number says. The yellow he had in mind measures 1.61:1 against white. Black on that same yellow measures 9.93:1. Same two colors, opposite jobs, and the difference between unreadable and comfortable. His printed sheets go on the yellow board in black, not the other way round.

Fictional example

Yusra Ahmadi's monthly notice for the branch lobby screen. Shown on a screen in a lit library lobby, read at about ten feet by people walking past.

Known. The branch's template sets headings in a mid-gray that measures 3.03:1 against white. The notice's headings are set at 28 point.

Assumed. That the lobby screen shows what her laptop shows. Yusra's assumption; a lobby screen is often older, dimmer and in a brighter room.

Open. Whether the county's template is something she may change. Settled by: the person who owns the template, not by her.

What the number says. At 28 point the headings count as large scale, 18 point and above, so the threshold that applies is 3:1 and 3.03:1 passes it. The body text under them, at 14 point and not bold, is not large scale, so its threshold is 4.5:1, and the same gray fails it. The template is legal for headings and not for the text beneath them, which is a distinction worth having the number for. Her level-three lines move from the template gray to the template's near-black, which is a change inside the template's own palette, and she asks about the heading color rather than changing it.

8. Practice: measure, then print it gray Practice

Minimum: every text color measured, and one grayscale print read through. That is the result Start here asks for. Time: about 25 minutes. Materials: your piece, Contrast ratio, and a printer that can print gray.

  1. List every text color on the piece, as hex values from your own file. Most tools show the hex in the color picker. A piece usually has two or three; if it has six, that is a finding in itself.
  2. Measure each one against the background it actually sits on. Not against white, unless the background is white.
  3. Put the size and weight in, so the tool tells you which threshold applies rather than listing all of them. 18 point, or 14 point bold, is the line.
  4. Fix the failures in the cheapest order: swap which of the two colors carries the text; then darken or lighten one of them; then, last, introduce a different color.
  5. Walk the piece looking for anything told apart by color, and add a word, a shape or a position to each one.
  6. Print it in grayscale and read it through. Anything that has gone missing is something that was carried by color alone.
  7. Write the colors and the ratios on the brief in The piece plan, so the next version starts from a measurement.
Go deeper

The real-stock test. If the piece is going on recycled or colored stock, print one on that stock and look. The paper is not white, so your measured ratio against white was optimistic, and some papers soak ink enough to thicken thin strokes noticeably.

The room test. For anything on a screen in a room, go to the room, put it up, turn the lights to how they will be, and stand at the back. A projector in a lit room adds the room's light to your black, which flattens everything, and no number predicts it.

The simulator look. Section508.gov's page shows the same menu under typical vision, color blindness and low vision. Look at your own piece's colors against those examples, as a reminder rather than as a test; the actual test is still the grayscale print and the no-color-alone pass.

9. Your piece Your piece

10. Check your work Check your work

Criteria

  • Has every text color been measured against the background it actually sits on?
  • Does each one meet the threshold that applies at its size and weight, without rounding up?
  • Is there anything on the piece told apart by color and nothing else?
  • Does the grayscale print carry everything the color version does?
  • For anything on a screen or outdoors, have you looked at it in the real conditions rather than only measured it?

Worked example

Yusra's notice passes the first criterion after the measurement, and it failed the second before it: the same gray passed at 28 point and failed at 14, which is the distinction the threshold rule exists to draw. Nothing on the notice is told apart by color, because the events are distinguished by their times. The grayscale print changed nothing, which is the result you want. The criterion still outstanding is the last one, because the lobby screen is older and dimmer than her laptop, and the only way to settle it is to stand in the lobby.

Common mistakes

  • Measuring against white when the background is not white. Measure the pair you have.
  • Rounding 4.47 up to 4.5. The W3C's own explanation says 4.499:1 does not meet the threshold.
  • Treating hue difference as contrast. Red on dark blue measures 2:1.
  • Taking a pass as a verdict. The number is a floor; the walk-back is the test.
  • Light text on a light brand color. If one color is fixed, make the fixed one the background and put dark text on it.
  • Carrying a category by color and labeling it only in a key.
  • Checking a deck on a laptop and showing it on a projector in a lit room.

What is still unresolved

This chapter measures a pair; it does not build a palette. Choosing a set of colors that work together, and deciding how much of each to use, is a different job, and it is covered properly on a sibling manual: Develop a palette and distribute it. The ratio also says nothing about how big the text is, which is Letter height from distance and Type you can read. And where a building's signs are covered by the ADA, the requirements are legal ones and a code official settles them, not a calculator.

11. Knowledge check and scenario

Why can two colors look violently different and still measure about 2:1?
Because the ratio measures lightness, not hue. The formula converts each color to a relative luminance, weighting green most heavily and blue least, and compares those two numbers. Red and dark blue can sit at almost the same luminance while being at opposite ends of the hue circle, so the eye registers a huge difference and the measurement registers almost none. That is the case the number exists to catch.
Your gray headings measure 3.03:1 and your gray body text is the same gray. One passes and one fails. Why?
Because the threshold depends on the size and weight. Large-scale text, which WCAG defines as at least 18 point or 14 point bold, has a 3:1 threshold; everything else has 4.5:1. At 28 point the headings clear 3:1; at 14 point and not bold, the body text needs 4.5:1 and the same gray does not reach it.
What does the grayscale print find that the contrast checker does not?
Information carried by color alone. The checker measures one pair of colors at a time and has nothing to say about whether the red route and the blue route on your map are distinguishable once both are gray. It also exposes pairs that were relying on a hue difference, and it is not an artificial test: somebody will photocopy your flyer.
(Go deeper) Your headline sits on a photograph. What does WCAG tell you about the ratio?
Nothing directly. WebAIM states that WCAG gives no guidance for gradients, semi-transparent colors or background images, and recommends testing the area of lowest contrast instead, which means measuring your light text against the lightest patch of the photo under it. The more reliable moves are to put the text on a solid band or panel, or to put a flat overlay under it, because a flat color is something the formula can measure.
A club's colors are a light gold and a cream, and you have been told to use them. Your event name in gold on the cream background measures 1.9:1.
At 1.9:1 the event name is close to invisible to a reader with ordinary aging of the eye, and it will disappear entirely in a photocopy. Being told to use two colors is not the same as being told which one carries text, and that distinction is usually available to you without anybody's permission.
This is the cheapest fix and it keeps both colors. The ratio is symmetrical, so a light color is fine as a background and poor as text; swapping the jobs can take the same pair from a failure to a comfortable pass. Measure the new pair rather than assuming, and check the whole piece in grayscale afterward.
Reasonable, and WebAIM says explicitly that an outline color can serve as the text color for measurement. The tradeoff is that it works at large sizes and clogs up small ones, and that it is harder to keep consistent across a set of pieces than simply choosing which color carries the text.

Checklist

Records your learning only; it is not a qualification.