APCA CONTRAST CALCULATOR
SAPC DEVELOPMENT VERSION
THIS IS NOT A PRODUCTION SITE
Please use the main APCA or BPCA sites for actual contrast testing. The results on this site may vary due to live experiments, and are not intended for use as a normative color guideline.
SAPC-G CONTRAST Click To Swap |
|||||||||
---|---|---|---|---|---|---|---|---|---|
|
|
||||||||
All Font Sizes are in CSS px • Fonts Under 80px Shown With Colors at Actual Size & Weight | |||||||||
SCORE | 100 | 200 | 300 | 400 Normal |
500 | 600 | 700 Bold |
800 | 900 |
Preferred | |||||||||
SCORE 4 | |||||||||
SCORE 3 | |||||||||
SCORE 2 | |||||||||
SCORE 1 | |||||||||
UPPER XXXXXXXXXXX
LOWER XXXXXXX
|
Click Here for Research ModeExit
RESEARCH MODE ACTIVE
BETA: 0.98G • g4g • TRC:
TEXT COLOR
BACKGROUND
About Research Mode
- "Static Target" is a target with useful features for judging perceived contrast.
- "Constant Contrast" is an interactive tool where you can adjust the text and background simultaneously to maintain a specific contrast.
- Enter the desired contrast level in the small input window that is left of the slider label.
- For reverse contrast, use a negative number.
- The is a slider control is approximately at the perceptual middle of the contrast while in the green zone.
- When in the red zone, the lower or upper color is at the maximum (#000 or #fff respectively).
- It is less accurate at very low contrasts, less than 10.
- "Split Contrast" is an interactive tool that inserts an achromatic background in between the luminances of the text and background of the main tool.
- There is a slider that allows you to adjust the luminance of the middle grey.
- The grey may not always be between the text and BG luminances until you move the slider so it can refresh the colors.
- This is a simplified version of one of the experiments used here for evaluating model parameters.
- "Dynamic Fonts" is the default font size and weight grid.
- Immediately beneath the "Mode Select" is a table of the constants currently in use for this tool.
- The lower results panel is filled with data about the colors, including LAB and LUV, and some of the raw SAPC values.
DEV 0.98G DEVELOPMENT VERSION
SAPC/APCA Visual Contrast Calculator
Beta 0.98G evaluation • g4g
Generate a URL of This Color Pair
Please Enter Valid Colors First!
Click on a color patch next to "Text" or "Background" above to use the HTML5 color-picker (modern browsers). Otherwise enter color values in the text-box as a three or six digit hex value, the '#' is not necessary. Other valid entries are integer rgb(r,g,b) or an HTML color name (see bottom of page for list).
NEW: Using the 0.98G 4g Series Constants
Results will be slightly different from the 2020 version of APCA
IMPORTANT: This version is using a new set of constants that are better at predicting perceptually uniform contrast. The lookup table on this page has been rescaled to match the new constants, so functionally the usage is the same, though the contrast values will be different.
PROBLEMS? Try a "Forced Reload" on your browser, and/or clear the cache. This is the SAPC version, which is part of the research project, and may at times be slightly erratic due to updates — if you are having problems usually a forced reload will fix.If you're having any issues today, try that version. For comments or to report issues, please visit us on GitHub.
About This Month's Default Color Pair
The default pair of colors in the tool this month, to kick off the new year, is an orange#ea7439
background and a white text. This is the color like the infamous "orange button problem" that originally brought my attention to the math issues in the old contrast method. As you can see above, SAPC indicates a much more accurate contrast prediction based on perception.
A little different than the article, the color above
#ea7439
and white fails WCAG2 completely, yet if you replace the white with black, WCAG2 math gives it a 7:1 (!!!) Here, with the perceptually accurate SAPC/APCA D series, it passes with white, but black fails (as it should) for all but very large fonts.
(If you came to the site with a different color pair in the URL, click here to load the demo colors.)
Click the white patch to the left of the text color entry to bring up a color picker that should update live (most browsers) and slide down to black to see the display update recommended minimum font sizes in real time. Dragging all the way to black, you'll see the tool indicates a lower contrast as per perception.
It should be noted that those with most forms of CVD prefer the white text as well. Take a screenshot and view it on our CVD simulator to see how contrast actually improves for white text on orange.
For a more in depth look at this, please see
this GitHub Gist with colorful examples.
Accessible Contrast
NEW! Draft Guidelines for the Use-Case Conformance Model
Understanding Use Cases and Conformance Levels
- FLUENT
- Fluent Readability, Block/Body Text
- Defined as: a block or column of more than two continuous lines of content text that uses a readable font with an x-height of ~19px or less.
- Fluent Readability, Primary content that is not body text
- Defined as: up to two and a half lines of continuous text.
- Includes headlines, captions, and images of text, if they contribute to content
- primary navigation and primary menus
- asides, tool-tips, spoilers, "continued"
- user entered text in forms, fields, etc
- does not include text the user controls or adjusts in size or color
- Large Fluent header/title content
- Defined as: fluent subcategory of "large content" such as big, bold headlines, and generally referring to text larger than 36px.
- SUB FLUENT
- Soft Readability, small sub-fluent secondary/ancillary content
- Defined as: non-primary content with relaxed readability needs.
- Applies to certain aspects of dataviz (call-outs, de-enhanced aspects of visual hierarchy)
- Category can include secondary/tertiary nav such as to TOS/EULA
- May include byline, short duplicative captions, footer matter.
- Spot Readability, sub-fluent "non-content"
- Defined as: non-content text of an incidental nature.
- This category includes non-informative placeholder text, disabled controls, copyright/trademark/license bugs (but not actual license or legal text blocks)
- Logo or Branding, brand related logo, symbol, service mark.
- This category relates to specific colors that are required as part of a brand or logotype.
- Incidental Text in Images text in images not critical to the understanding, nor specifically contributing to the content.
Conformance Levels: Bronze, Silver, and Gold
- BRONZE: Covers primary content text only.
- There is no font lookup table, only a set of general conformance levels.
- Use-cases for "body text" and "other content text".
- Spot text: disabled, placeholder, ancillary, decorative text is not covered
- Logos and incidental text in images are not covered
- There is no specified minimum font size.
- There is no requirement to match a reference font weight or size.
- SILVER: Covers all text content.
- Font weight and size per Lc contrast value and font lookup table.
- Use-cases for "body text", "fluent text", "large fluent text", "sub-fluent text".
- Logos are covered, with a contrast requirement reduced by Lc 15.
- Spot text: disabled, placeholder, ancillary, decorative text are covered as a recommendation (should)
- The minimum font size for content is 13px, based on an x-height ratio of 0.5 (minimum x-height of 7.5px)
- Minimum font size for non-content text is 10px.
- There is no requirement to compare to a reference font weight or size.
- GOLD: Covers all text content, enhanced.
- Font weight and size per Lc contrast value and font lookup tables per use cases.
- Use-cases for "body text", "fluent text", "large fluent text", "sub-fluent text", "spot text" (Disabled, placeholder) and Logos.
- Ancillary, decorative text are covered with recommendations
- The minimum font size for content text is 18px, based on an x-height ratio of 0.5 (minimum x-height of 9px).
- Minimum font size for non-content text is 12px.
- Fonts used for content text must be compared to a reference font's weight or size, and appropriate offset used for equivalency.
APCA Guidelines: Simple Levels
These general levels are appropriate for use without reference to the lookup table. The lookup table simply adds additional accuracy, which allows for greater flexibility.
- Lc 90 • Preferred level for fluent text and columns of body text with a font no smaller than 18px/weight 300 or 14px/weight 400 (normal), or non-body text with a font no smaller than 12px. Also a recommended minimum for extremely thin fonts with a minimum of 24px at weight 200. Lc 90 is a suggested maximum for very large and bold fonts (greater than 36px bold), and large areas of color.
- Lc 75 • The minimum level for columns of body text with a font no smaller than 24px/300 weight, 18px/400, 16px/500 and 14px/700. This level may be used with non-body text with a font no smaller than 15px/400. Also, Lc 75 should be considered a minimum for larger for any larger text where readability is important.
- Lc 60 • The minimum level recommended for content text that is not body, column, or block text. In other words, text you want people to read. The minimums: no smaller than 48px/200, 36px/300, 24px normal weight (400), 21px/500, 18px/600, 16px/700 (bold). These values based on the reference font Helvetica. To use these sizes as body text, add Lc 15 to the minimum contrast.
- Lc 45 • The minimum for larger, heavier text (36px normal weight or 24px bold) such as headlines, and large text that should be fluently readabile but is not body text. This is also the minimum for pictograms with fine details, or smaller outline icons, , no less than 4px in its smallest dimension.
- Lc 30 • The absolute minimum for any text not listed above, which means non-content text considered as "spot readable". This includes placeholder text and disabled element text, and some non-content like a copyright bug. This is also the minimum for large/solid semantic & understandable non-text elements such as "mostly solid" icons or pictograms, no less than 10px in its smallest dimension.
- Lc 15 • The absolute minimum for any non-text that needs to be discernible and differentiable, but does not apply to semantic non-text such as icons, and is no less than 15px in its smallest dimention. This may include dividers, and in some cases large buttons or thick focus visible outlines, but does not include fine details which have a higher minimum. Designers should treat anything below this level as invisible, as it will not be visible for many users. This minimum level should be avoided for any items important to the use, understanding, or interaction of the site.
These define the basic minimum levels, what you might think of as A/AA in the old WCAG 2. For the equivelent to AAA, simply increase the contrast values by Lc 15.
Notes on font size
- Font sizes listed above assume an x-height ratio of at least 0.5
- i.e. the vertical size of the lower case x is one-half the font size or larger, as rendered to screen.
- The reference font x-height ratio is 0.52, and it is preferential to use an x-height of 0.52 to 0.57
- Font weight is based on highly standardized reference fonts such as Helvetica or Arial
- "px" means the CSS reference px, not device pixels. The reference px is defined as 1.278 arc minutes of visual angle.
- When selecting, or testing, a font size, simply determine the font's x-height ratio, and the amount it should be increased.
- EXAMPLE:
- For instance, Times New Roman has an x-height ratio of 0.45, so it needs to be increased about 16% in size relative to the reference font.
- Therefore, if the reference font is set at 1em, Times should be set at 1.16em to be equivalent.
- If Times is the main document font, this adjustment can be set for the entire document using the root element via the
html
selector.html { font-size: 18.6px }
sets the entire documents rem (root em) such that 1rem = 18.6px
- For font weight, simply set a line of test text in the reference Arial or Helvetical at 400 weight and then below that the same text text in the new font. Try different weights to find the closest match.
- As an example, the font Raleway 400 weight is closest to Helvetica 300.
- So, always add 100 in weight to Raleway to be equivelent.
- See this discussion answer for more.
- Consider the font design as well as the basic size and weight, and the potential impact on readability. See this PDF "Evaluating Fonts" for general guidance and a comparison of a few dozen fonts for accessibility.
Using the Lookup Table
- Cross index reference font size (in CSS px) to CSS weight.
- Reference fonts for comparison include Helvetica Neue, Helvetica, K2D, Fira Sans, Kanit, and Arial.
- Fonts which exceed the reference fonts include Verdana, Convergence, Libre Baskerville, Artifika
- APCA Contrast Percentage must meet or exceed the value listed.
- For light text on a dark background the APCA tool will show a negative percentage. Simply use the absolute (positive) value. For example, if the APCA value is -58Lc, use 58Lc.
- A ⊘ indicates that a larger font size (or heavier font weight) must be used.
APCA CONTRAST LOOKUP TABLE | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Sorted by Contrast Value (Lc) | ||||||||||
Revised May 25, 2022 | ||||||||||
Reference Font Weight | ||||||||||
Font Size |
100 | 200 | 300 | 400 Normal |
500 | 600 | 700 Bold |
800 | 900 | |
pt | px | APCA Contrast Value (Lc) | ||||||||
9 | 12 | ⊘ | ⊘ | ⊘ | ®© | ®© | ®© | ®© | ⊘ | ⊘ |
10.5 | 14 | ⊘ | ⊘ | ®© | 100 | 100 | 90 | 75 | ⊘ | ⊘ |
11.25 | 15 | ⊘ | ⊘ | ®© | 100 | 90 | 75 | 70 | ⊘ | ⊘ |
12 | 16 | ⊘ | ⊘ | ®© | 90 | 75 | 70 | 60 | 60 | ⊘ |
13.5 | 18 | ⊘ | ®© | 100 | 75 | 70 | 60 | 55 | 55 | 55 |
15.75 | 21 | ⊘ | ®© | 90 | 70 | 60 | 55 | 50 | 50 | 50 |
18 | 24 | ⊘ | ®© | 75 | 60 | 55 | 50 | 45 | 45 | 45 |
21 | 28 | ⊘ | 100 | 70 | 55 | 50 | 45 | 43 | 43 | 43 |
24 | 32 | ⊘ | 90 | 65 | 50 | 45 | 43 | 40 | 40 | 40 |
27 | 36 | ⊘ | 75 | 60 | 45 | 43 | 40 | 38 | 38 | 38 |
31.5 | 42 | 100 | 70 | 55 | 43 | 40 | 38 | 35 | 35 | 35 |
36 | 48 | 90 | 60 | 50 | 40 | 38 | 35 | 33 | 33 | 33 |
45 | 60 | 75 | 55 | 45 | 38 | 35 | 33 | 30 | 30 | 30 |
54 | 72 | 60 | 50 | 40 | 35 | 33 | 30 | 30 | 30 | 30 |
72 | 96 | 50 | 45 | 35 | 33 | 30 | 30 | 30 | 30 | 30 |
APCA CONTRAST LOOKUP TABLE | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Sorted by Contrast Value (Lc) | ||||||||||
Revised May 25, 2022 | ||||||||||
Reference Font Weight | ||||||||||
Font Size |
100 | 200 | 300 | 400 Normal |
500 | 600 | 700 Bold |
800 | 900 | |
Lc Value | APCA Contrast Value (Lc) | |||||||||
Lc 100 | 42 | 26.5 | 18.5 | 15 | 14.5 | 13.5 | 13 | 16 | 18 | |
Lc 95 | 45 | 28 | 19.5 | 15.5 | 15 | 14 | 13.5 | 16 | 18 | |
Lc 90 | 48 | 32 | 21 | 16 | 15.5 | 14.5 | 14 | 16 | 18 | |
Lc 85 | 52 | 34.5 | 22 | 16.5 | 15.6 | 14.6 | 14 | 16 | 18 | |
Lc 80 | 56 | 38.3 | 23 | 17.3 | 15.8 | 14.8 | 14 | 16 | 18 | |
Lc 75 | 60 | 42 | 24 | 18 | 16 | 15 | 14 | 16 | 18 | |
Lc 70 | 64 | 44 | 28 | 19.5 | 18 | 16 | 14.5 | 16 | 18 | |
Lc 65 | 68 | 46 | 32 | 21.7 | 19 | 17 | 15 | 16 | 18 | |
Lc 60 | 72 | 48 | 42 | 24 | 21 | 18 | 16 | 16 | 18 | |
Lc 55 | 80 | 60 | 48 | 28 | 24 | 21 | 18 | 18 | 18 | |
Lc 50 | 96 | 72 | 60 | 32 | 28 | 24 | 21 | 21 | 21 | |
Lc 45 | 108 | 96 | 72 | 42 | 32 | 28 | 24 | 24 | 24 | |
Lc 40 | 120 | 108 | 96 | 60 | 48 | 42 | 32 | 32 | 32 | |
Lc 35 | NT | 120 | 108 | 96 | 72 | 60 | 48 | 48 | 48 | |
Lc 30 | NT | NT | 120 | 108 | 108 | 96 | 72 | 72 | 72 | |
Lc 25 | NT | NT | NT | 120 | 120 | 108 | 96 | 96 | 96 | |
Lc 20 | NT | NT | NT | NT | NT | NT | NT | NT | NT | |
Lc 15 | NT | NT | NT | NT | NT | NT | NT | NT | NT |
About the colors in these tables: The colors in these tables are designed to be discernible by all forms of color vision deficiency.
- The warning colors are grouped in a hue category that separates them from other colors for all CVD types.
- Important color codes also have a symbol such as ×, as color should never be the only coding for important information.
- Less important codes are directly related to the cell content, such as level 80, thus are self-symbolized.
- This follows into the accompanying legend.
APCA CONTRAST COLOR CODES |
---|
⊘ — PROHIBITED Except for Decorative Purposes |
©§™ — May be used for Copyright/ByLine ONLY |
× — Do Not Use for Body Text (Blocks or Columns) |
Weight 100 Fonts Should be Avoided |
> — Minimum Contrast for Text |
APCA 80 — Similar to WCAG 7∶1 for BG #ddd and lighter |
APCA 60 — Similar to WCAG 4.5∶1 for BG #d0d0d0 and lighter |
APCA 40 — Similar to WCAG 3∶1 for BG #ccc and lighter |
- Values shown are for common sans-serif fonts (e.g., Helvetica, Arial, Verdana, Montserrat, Roboto, Calibri, Trebuchet).
- Many serif fonts should use values for the row above (e.g., Times, Georgia, Cambria, Courier), and especially should be compared in terms of x-height.
- Decorative, unusual, and very thin fonts should be avoided for columns of body text.
- Due to the vast variety of font designs, designers should visually compare an unusual font to a standard font such as Helvetica, using the size and weight of Helvetica that most closesly matches the appearance of the tested font as a guide.
- Designers are cautioned that bypassing default font smoothing can drastically reduce contrast for small or thin fonts. For instance, the use of "webkit-font-smoothing: antialiasing" is strongly discouraged.
The Science Behind SAPC/APCA
Advanced Perceptual Contrast Algorithm
For a brief overview and explanation of the SAPC math and methods, take a look at Experiment Results CE17, one of the polarity experiments. The discussion includes graphs comparing SAPC to other contrast methods, and related discussions.
Also, as spatial frequency is one of the most important predictors of contrast perception and readability, see Experiment Results CE14-weight for further explanations.
The "TL;DR" is: like all human perceptions, color and contrast are extremely context dependent. In terms of readability, there is a "critical contrast" level, and that level is more dependent on spatial frequency, which relates to font weight, than a given color pair.
To accurately predict contrast perception, the Spatial (font weight & size), color (perceived lightness difference between text and background), and context (ambient light, surroundings, intended purpose of the text) all need to be taken into account.
What is the Contrast of This Page?
Most of this page is set at over 120 in "old" APCA numbers, which now is approximately 90Lc. To help differentiate between dark text on a light background and light text on dark, the math reports the latter as a negative value. But for purposes of the font lookup table, ignore the minus sign and use the absolute value.
Minimum Type Size
Examples for Various Levels
Here are a set of type samples using the above selected colors. The first is the standard sans-serif Helvetica Neue, a very common font that was used as the reference font for many of the perception experiments. The initial serif font sample shown is Trirong. The samples here (other than Helvetica) can be found on Google fonts.
On the left of each sample line is the level, as in APCA contrast Lc60 (positive or negative). This (and the above chart) are based on the standard font "Helvetica" but as should be clear when choosing other fonts, the variation in weight is enough to change perceived contrast. You can scroll the samples left to see smaller text.
At the end of each sample section you can select alternate test fonts. You'll notice there are substantial differences in font weight, especially noticeable in the very light and thin fonts. Designers and developers should be aware of these differences, as adjust to compensate for differences relative to a reference standard font.
It is further advised to test fonts on various major browsers, as each browser renders fonts differently, especially thin fonts and fonts with poor hinting. For instance, the sample font "JOST" renders differently in Safari, Chrome, Opera, and Firefox. On MacOS, while Safari and Firefox maintain some legibility in the very thin 100 weight Jost, the thin versions of Jost literally disappear in Chrome and Opera.
SANS SERIF FONT SAMPLES ←scrollable→
Sans Serif Font Selectors § Current: Montserrat
Notes: K2D does not have a 900wt, and the Helvetica 600wt is condensed.