Colour contrast

Pick a foreground (text) and a background colour to get the WCAG contrast ratio (1:1 to 21:1), see whether body text and large text pass AA / AAA, and when they do not, get a concrete fix such as “make the background darker to #767676” with one click to apply. Both colours are shown as HEX / RGB / HSL with relative luminance, common pairs are built in, and the foreground and background can be swapped or the summary copied. Everything is computed locally in your browser; nothing is uploaded.

Free and no sign-up. Colour contrast computes and renders entirely in your browser; nothing you enter is uploaded.

More tools in More tools

Frequently asked questions about Colour contrast

How is the contrast ratio computed, and why does it max out at 21:1?
Each colour is first turned into relative luminance: divide every channel by 255, then undo the sRGB gamma (divide by 12.92 at or below 0.04045, otherwise raise ((v + 0.055) / 1.055) to the power of 2.4), and weight the channels 0.2126, 0.7152 and 0.0722. Contrast = (lighter luminance + 0.05) / (darker luminance + 0.05). Pure black has luminance 0 and pure white 1, so (1 + 0.05) / (0 + 0.05) = 21 — that is the theoretical maximum, and closer colours approach 1:1.
What is the difference between AA and AAA, and why are the thresholds different for large text?
WCAG 2.1 asks for at least 4.5:1 for body text at AA and 7:1 at AAA. Large text — 18pt, roughly 24px at regular weight, or 14pt, roughly 18.66px bold — has thicker strokes, so the thresholds drop to 3:1 for AA and 4.5:1 for AAA. All four are listed side by side so you can see which pass and which fail: a heading-only palette can be judged as large text, but as soon as there is a paragraph, 4.5:1 applies.
Where do the suggested colour values come from, and can I use them directly?
With the other colour held fixed, the side being adjusted is walked one step at a time (1/255) towards darker and towards lighter, and the first value that crosses the threshold is kept. Suggestions are then ordered by how much they change, and anything beyond a 50% shift is dropped — that is essentially “turn everything black or white” and tells you nothing. A suggestion only guarantees the ratio, not that it looks good or matches your brand, so check it against the preview before adopting it.
Why does a pair look fine in a screenshot but fail the check?
Your eye is influenced by font size, weight, surrounding whitespace and screen brightness, while WCAG only sees the relative luminance of two colour values. Light grey on white or coloured text on a pale background is the usual culprit: a word or two looks fine, but a whole paragraph becomes tiring, especially at small sizes and low brightness. Judging with the actual font size (4.5:1 for body text) is more reliable than intuition. Translucent colours should be composited with the background first — this page only handles opaque values.
Does the checker upload my colours? Do I need to pay or sign in?
No on both counts. Colour parsing, contrast computation and the suggestions all run locally in your browser; nothing is uploaded, nothing is written to local storage, and everything is released when you close the page. The tool is free, needs no account and has no usage limit.
Does the content these tools process stay local?
No. Your input exists only in the memory of the current page, is released when you reload or close it, and is never written to local storage.
Can I keep using the tools offline?
Once the page has loaded, regex testing, Emoji lookup, colour reference and character conversion need no network; only the IP address page needs to be online, because it asks our backend for your local outbound address when it opens.
Do I need to register or pay to use Colour contrast?
Most tools are free with no sign-up and no usage limits; a few pay-per-use features (AI watermark removal, AI background removal, AI image generation, AI upscaling, AI ID photo, AI annotation, PDF to Word, AI flowchart, AI mind map and AI Mermaid chart) show their price on the page.
Is the data I process with Colour contrast uploaded to a server?
No. Computation and rendering happen locally in your browser and your input is never sent to the server; only the IP address page queries our backend for your public IP on entry, carrying no input. Features that need backend processing (AI watermark removal, AI background removal, AI image generation, AI upscaling, AI ID photo, AI annotation, PDF to Word, AI flowchart, AI mind map, AI Mermaid chart and the SME financial report) explain their upload scope on their own pages.

About Local Toolbox

Local Toolbox groups the small tools you reach for every day by what you are doing: formatters and converters, date maths, documents and résumés, codes and ID cards, images, encryption, diagramming, and annotation and accounting. Open a page and start working — no sign-up, and almost every tool has no usage limit.

Most features compute inside your browser, so your input never leaves your device; the pages are plain static assets, load fast and keep working offline. The IP page asks our backend for your outbound address when it opens and sends none of your input. AI watermark removal, AI background removal, AI image generation and AI upscaling send content to our backend for inference (watermark removal is ¥1 per run; background removal is ¥1 per run; image generation and upscaling are priced by resolution — 2K ¥2, 4K ¥3); AI annotation sends images to a large model that locates the target and returns coordinates (¥0.5 per image, refunded only when every image in the batch fails); AI flowchart, AI mind-map and AI Mermaid chart generation send your text description to a model that builds the diagram (three separate products, charged ¥0.5, ¥0.5 and ¥0.5 per run respectively); and the accounting helper sends the income, expense, social-insurance and balance figures you fill in to generate a report (¥0.5 for the spoken analysis, ¥1 for the report). These features accept Alipay and WeChat Pay, upload nothing before payment succeeds, and refund automatically if processing fails.

Links