On many checkout pages, an expiration-date field starts with a neutral gray outline, then switches to red the moment validation fails. That red border feels like instant feedback, but on its own it cannot tell a shopper which field broke or what fixing it requires. Choosing accessible checkout form error border colors means treating three questions separately: does the border have enough contrast against its background to register as a control, does the state change rely on hue alone, and is the error also described in text that a screen reader can announce. WCAG 2.2 keeps these requirements distinct. SC 1.4.11 covers non-text contrast for the visual information needed to identify a component or its state, SC 1.4.1 rules out color as the only signal, SC 3.3.1 requires an automatically detected error to be identified and described in text, and SC 3.3.3 asks for a correction suggestion when one is known and safe to give (w3.org). A shopper with red-green color vision deficiency may not register that hue shift at all; running your palette through a color blindness simulator makes this gap visible before customers ever see it.
Table of Contents

Why a Red Border Isn’t an Accessible Checkout Form Error Border Color on Its Own
Picture the field again: a neutral #767676 outline sits quietly until the customer submits, then the border flips to #B91C1C. That hue change is genuinely useful for someone who can see color clearly and is already looking at the field. It does almost nothing for three other groups: people with color vision deficiencies who may perceive little difference between the two states, people with low vision who might miss a thin one- or two-pixel line change entirely, and anyone using a screen reader, who receives no visual signal at all unless the state is also exposed in the accessibility tree and in visible text.
WCAG 2.2 does not ban red error borders. It asks you to satisfy several requirements at once rather than treat one red line as a complete solution. SC 1.4.1 rules out using color as the only method of conveying that information, which is why a border-color swap needs a companion cue such as an icon, a label change, or text (w3.org). SC 3.3.1 separately requires that when an error is detected automatically, it is identified and described in text, and SC 3.3.3 adds that a correction suggestion should be offered when one is known and providing it will not compromise security (w3.org). Read together with a resource like the site’s own guide on designing for color blindness, the practical takeaway is that the border color is one signal among several, not the whole mechanism.
Try this palette: #767676 #B91C1C #FFFFFF #F1F5F9

The Four-Case Comparison: Default and Error States on White and Tinted Pages
Most checkout layouts put the same field on more than one surface: a plain white card for the main form and a tinted panel for an order summary or a secondary step. Test each combination separately rather than assuming one contrast check covers the whole page. A useful illustrative matrix uses a neutral #767676 default border and a #B91C1C error border against both a white #FFFFFF page and a tinted #F1F5F9 panel.
| State | Border color | Adjacent background | What you’re checking |
|---|---|---|---|
| Default | #767676 | #FFFFFF | 3:1 non-text threshold on the white card |
| Default | #767676 | #F1F5F9 | 3:1 non-text threshold on the tinted panel |
| Error | #B91C1C | #FFFFFF | 3:1 non-text threshold on the white card |
| Error | #B91C1C | #F1F5F9 | 3:1 non-text threshold on the tinted panel |
If the input itself stays white even when it sits on a tinted page, check the border against that white interior too, since that is the color actually touching the border line. W3C’s own guidance uses a mid-gray value close to #767676 as an example of a border that reaches the 3:1 non-text threshold on white, but treat that as a starting point to verify in your exact rendering, not a guarantee (w3.org). Note too that SC 1.4.11 does not require the default and error border colors to contrast against each other at 3:1, since the two states typically do not appear next to one another on screen at the same time; the requirement applies to each state against its own adjacent background.
Try this palette: #767676 #B91C1C #FFFFFF #F1F5F9

How to Test Accessible Checkout Form Error Border Colors with a Contrast Tool
Once you know which adjacent colors matter, the checking process itself is repetitive by design. Open 66Colorful’s Contrast Checker and work through each pair one at a time:
- Enter the default border color as the foreground and the white page background as the background, then read the non-text result rather than the normal-text result.
- Repeat with the default border against the tinted panel background.
- Enter the error border color against white, then again against the tinted panel.
- Switch to checking text: enter your error message color against its background and read the normal-text AA result at 4.5:1, or the large-text threshold of 3:1 only if the message genuinely qualifies as large text.
- If the input’s interior stays white on a tinted page, add that white-on-border pairing as a fifth check.
Two cautions matter here. First, the tool’s initial or placeholder ratio on load is not evidence that your colors pass; only trust a result after you have entered your intended pair. Second, the live preview is a helpful sanity check, not a complete accessibility audit; it tells you about a contrast ratio, not about wording clarity, screen reader announcement timing, or whether a one-pixel border renders as faint as its CSS value on an actual monitor (w3.org).
Try this palette: #767676 #B91C1C #FFFFFF #F1F5F9
Building an Accessible Field and Message Pattern in Markup
Contrast-checked colors only solve the visual half of the problem. Pair the border change with a visible, field-specific message such as “Expiration date: Use MM/YY.” rather than a generic “This field is required.” Associate that message with its input programmatically so assistive technology reads it as part of the field’s description, and set the invalid state only after validation actually detects a problem, not before the customer has had a chance to fill anything in.
<label for="exp-date">Expiration date</label> <input id="exp-date" type="text" aria-describedby="exp-date-error" aria-invalid="true" > <p id="exp-date-error" role="alert"> Expiration date: Use MM/YY. </p>
W3C’s forms tutorial illustrates this inline-text and aria-describedby pattern, and MDN documents how aria-invalid should reflect the field’s actual validation state rather than being hardcoded (w3.org, developer.mozilla.org). Treat this as one workable implementation, not the only ARIA layout that satisfies SC 3.3.1. Once the message exists, check its own readability with a legibility analyzer in addition to its raw contrast ratio, since small error text under a busy field benefits from a second look at size and spacing, not just color.
Try this palette: #B91C1C #7F1D1D #FFFFFF #F1F5F9
A Practical Review Checklist Before You Ship
Before treating a checkout error state as finished, walk through these checks in order:
- Default border tested against every background it actually appears on, including white and tinted surfaces.
- Error border tested against those same backgrounds, and against the input’s interior color where it differs from the page.
- Error message text checked at the normal-text or large-text threshold, not assumed from the border result.
- A non-color cue present alongside the border change, such as an icon or a text label update.
aria-invalidand the associated message only appear after validation runs, not preemptively.- Keyboard-only and screen reader passes confirm the message is announced and the field remains reachable and focusable.
For a full page with several fields, checking pairs one at a time gets tedious quickly. Running the complete set of foreground-background combinations through a palette accessibility matrix gives you every default, error, white, and tinted result in one pass instead of repeating single checks field by field.
Try this palette: #767676 #B91C1C #F1F5F9 #7F1D1D
Frequently asked questions
Does WCAG require a specific hex color for error borders?
No. SC 1.4.11 requires a 3:1 contrast ratio for the visual information needed to identify a control or its state against its adjacent background, not a fixed color. Any hue can work if it meets that ratio in your actual layout and is paired with a non-color cue.
Can I keep a red error border if it’s already my brand’s error color?
Yes, as long as it clears the 3:1 non-text threshold against the backgrounds it actually appears on and the error is also identified in visible text, since color alone still cannot satisfy SC 1.4.1.
Do the default and error border colors need to contrast with each other?
SC 1.4.11 does not impose a blanket requirement that the two states contrast at 3:1 against each other, since they typically do not appear side by side. Test each state against its own background instead.
What contrast ratio does the error message text need?
Treat it as normal text requiring 4.5:1 against its background, or 3:1 only if the message qualifies as large text under WCAG’s size definitions.
When should aria-invalid be set to true?
Only after validation actually detects a problem with that field’s value, not as soon as the page loads or before the customer has had a chance to enter anything.
Is a red icon enough instead of an error border color change?
An icon can serve as a useful non-color cue, but it still needs an accessible name or adjacent text, since an icon alone can face the same color-only and screen reader gaps as a border alone.
Does passing the contrast checker mean my checkout error state is fully accessible?
No. A contrast result confirms one visual measurement. You still need to verify wording clarity, correct ARIA association, keyboard reachability, and screen reader announcement timing separately.
Next steps
A red border can still be part of an accessible checkout error state, but it is never the whole solution. Building accessible checkout form error border colors means testing the default and error border against every background it touches, checking the message text separately at its own threshold, backing the color change with a non-color cue, and exposing the error to assistive technology through text and the right ARIA attributes at the right moment. None of these steps replace the others; a passing contrast number does not confirm good wording, and clear wording does not confirm a visible border. As a next step, run your current checkout states through a focus indicator checker as well, since a customer who tabs to a field in error needs to see both the focus ring and the error state clearly, not one at the expense of the other.
Related tools & resources on 66Colorful:
- Contrast Checker
- Palette Accessibility Matrix
- Designing For Color Blindness
- Color Blindness Simulator
- Legibility Analyzer
- Focus Indicator Checker
Sources and further reading
- https://www.w3.org/WAI/WCAG22/Understanding/error-identification
- https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-invalid
- https://www.w3.org/WAI/WCAG22/Understanding/non-text-contrast
- https://www.w3.org/WAI/WCAG22/Understanding/use-of-color
- https://www.w3.org/TR/wcag/
- https://www.w3.org/WAI/tutorials/forms/notifications/