# Color contrast checker > How readable is this text on this background? Check the WCAG contrast of text on a background, see which levels it passes, and get a nearby colour that does. Check the WCAG 2.2 contrast ratio of text on a background. See AA and AAA results for normal and large text, with the nearest passing text colour. - Page: https://how.box/contrast/ - Runs entirely in the browser. - License: HowToolbox's own text and data (titles, explanations, FAQs, tool descriptions and schemas, this file) are CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/); AI training and answers are welcome. Attribute "HowToolbox (how.box)" with a link to the page used. Third-party data keeps its own terms; the name and logo are not licensed. Publisher: HowToolbox, contact@how.box. Terms: https://how.box/about/terms/ ## Inputs Answer link: https://how.box/contrast/?fg={fg}&bg={bg} - `fg` (text): The text color, as any CSS color text (with or without the # of a hex color). Example: `#767676`. - `bg` (text): The background color, as any CSS color text. Example: `#ffffff`. Example answer: https://how.box/contrast/?fg=%23767676&bg=%23ffffff A complete link carries the primary answer in the page HTML; a missing or invalid value shows the default page. ## Agent tools - `contrast_check`: Checks the WCAG 2.2 contrast of a text color on a background color. - MCP, one POST to https://how.box/mcp: `{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"contrast_check","arguments":{"text":"#767676","background":"#ffffff"}}}` - GET: https://how.box/mcp/run/contrast_check?text=%23767676&background=%23ffffff ## How it works The Web Content Accessibility Guidelines (WCAG 2.2) rate how well text stands out from its background by a contrast ratio from 1:1 (no difference) to 21:1 (black on white). Level AA asks for at least 4.5:1 for normal text and 3:1 for large text, which is 18 point or larger, or 14 point and bold (success criterion 1.4.3). Level AAA asks for 7:1 and 4.5:1 (1.4.6). Icons, form borders and other parts you need to see must reach 3:1 (1.4.11). The ratio is (L1 + 0.05) ÷ (L2 + 0.05), where L1 is the relative luminance of the lighter colour and L2 of the darker one. Relative luminance is 0.2126 R + 0.7152 G + 0.0722 B of the linearized red, green and blue values. For example #767676 on white has L = 0.181 against 1, so (1 + 0.05) ÷ (0.181 + 0.05) is 4.54:1. The ratio is cut, never rounded up: 4.499 does not meet 4.5. A text colour with transparency is first laid over the background, and a background with transparency over white. The suggested colour keeps the hue and chroma of your text colour and moves only its lightness (in OKLCH) to the nearest value that passes, so it still looks like your colour. Contrast is only one part of readability: font, size and weight matter too, and the ratio says nothing about colour-blind readers beyond lightness. ## FAQ **What is large text in WCAG?** Text of at least 18 point (24 px), or at least 14 point (about 18.7 px) and bold. It needs less contrast because bigger letters are easier to read. **Which level should I aim for?** Level AA is the usual legal and design target. Level AAA is stricter and is not always possible for a whole site, but is worth using for long reading text. **Does the ratio depend on which colour is the text?** No. The ratio is the same if you swap the two colours. Only the sample and the suggested replacement change, because the suggestion adjusts the text colour. **Does passing the contrast test make my page accessible?** No. It checks only colour contrast. Keyboard access, text alternatives and other accessibility requirements still matter. **Why does a ratio just below 4.5 fail normal-text AA?** The threshold is 4.5:1, without rounding up. The displayed ratio is cut to two decimals so a failing value does not appear to pass. More: [HowToolbox index](https://how.box/llms.txt) · [Agent Skill](https://how.box/skill.md) · [agent terms](https://how.box/about/agents/)