# Colour contrast checker

> Check the contrast ratio of a text colour on a background against WCAG AA and AAA for normal and large text, with a live sample. Free.

Free tool by Orkosi. Page: https://orkosi.com/tools/contrast-checker

Pale grey text on white looks elegant and is hard to read for anyone with tired eyes or a phone in the sun. Check a colour pair against the accessibility standard before it ships.

1. Type the text colour and the background colour.
2. Press Check.
3. Read the ratio and which WCAG levels it passes.

## Input

| Field | Type | Required | What it is |
| --- | --- | --- | --- |
| `foreground` | text | yes | Text colour. |
| `background` | text | yes | Background colour. |

## Example

Input:

```json
{
  "foreground": "#6B7280",
  "background": "#FFFFFF"
}
```

Result:

```json
{
  "ratio": 4.83,
  "ratio_text": "4.83:1",
  "aa_normal": "Pass",
  "aa_large": "Pass",
  "aaa_normal": "Fail",
  "aaa_large": "Pass",
  "verdict": "Passes AA for all text.",
  "preview": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 640 140\" width=\"640\" height=\"140\" role=\"img\" aria-label=\"Contrast preview\"><rect width=\"640\" height=\"140\" fill=\"#FFFFFF\"/><text x=\"32\" y=\"62\" font-family=\"system-ui,sans-serif\" font-size=\"30\" font-weight=\"700\" fill=\"#6B7280\">Large text sample</text><text x=\"32\" y=\"102\" font-family=\"system-ui,sans-serif\" font-size=\"16\" fill=\"#6B7280\">Body text sa…"
}
```

## Run it

It needs a free Orkosi account, nothing else. No credits are used.

- **A person**: open the page, enter an e-mail once, use the tool.
- **Claude or ChatGPT**: add the Orkosi connector `https://orkosi.com/api/v1/public/mcp` and sign in, or create the free account on the sign-in page. Then call `orkosi_run_free_tool` with `{ "tool": "contrast-checker", "input": { … } }`.
- **Any agent or program that can make an HTTP request**:

  1. Once, create the account: `POST https://orkosi.com/api/v1/public/signup` with `{ "name": "…", "email": "…", "terms_accepted": true }` and no key. Ask the person for the e-mail and their agreement to the terms first. The answer carries `data.api_key`, shown once.
  2. Run the tool:

```bash
curl -X POST https://orkosi.com/api/v1/public/tools/contrast-checker/run \
  -H "Authorization: Bearer $ORKOSI_API_KEY" -H "Content-Type: application/json" \
  -d '{"input":{"foreground":"#6B7280","background":"#FFFFFF"}}'
```

The answer is `{ "data": { "tool": "…", "result": { … } } }`. A call without a key is answered 401 with the signup steps as data.

## Questions

**What contrast ratio does WCAG require?**

Level AA needs 4.5:1 for normal text and 3:1 for large text. Level AAA needs 7:1 and 4.5:1.

**What counts as large text?**

24 pixels and up, or 19 pixels and up when bold (18 and 14 points).

**Does this apply to buttons and icons?**

Yes. Interface components and meaningful graphics need at least 3:1 against what is next to them.

All free tools: https://orkosi.com/tools.md
