색상 대비 검사기
전경/배경 색상 쌍에 대한 WCAG 2.1 대비 비율을 확인하고 즉시 통과/실패 결과를 얻으세요.
이 도구에 대해
16진수 색상 선택기 또는 텍스트 필드를 사용하여 전경 및 배경 색상을 입력하세요. 도구는 WCAG 2.1 대비 비율을 계산하고 네 가지 임계값에 대한 통과/실패 배지를 표시합니다: AA 일반 텍스트(4.5:1), AA 큰 텍스트(3:1), AAA 일반 텍스트(7:1), AAA 큰 텍스트(4.5:1). 라이브 미리보기는 선택한 색상으로 일반 및 큰 크기 모두에서 샘플 텍스트를 렌더링합니다. 각 색상의 상대 밝기도 표시됩니다. 현재 색상이 AA를 충족하지 않으면 도구가 표준을 충족하는 조정된 색상을 제안합니다.
사용 방법
- 1 색상 선택기를 사용하거나 16진수 값을 입력하여 전경 색상을 선택하세요.
- 2 같은 방식으로 배경 색상을 선택하세요.
- 3 대비 비율을 읽고 어떤 WCAG 레벨이 통과 또는 실패하는지 확인하세요.
- 4 라이브 텍스트 미리보기를 보고, AA 준수를 위해 필요한 경우 제안된 색상을 사용하세요.
Why contrast is an accessibility requirement, not a preference
Text that is too close in brightness to its background is hard to read — and for people with low vision, color blindness, or anyone using a phone in bright sunlight, it can be unreadable. The Web Content Accessibility Guidelines (WCAG) turn "readable enough" into a measurable number called the contrast ratio, ranging from 1:1 (foreground and background identical) to 21:1 (pure black on pure white). This tool computes that ratio for any two colors and tells you which WCAG levels they pass, so design decisions stop being guesswork.
The formula, step by step
The contrast ratio is not based on the raw HEX values — it is based on how bright each color appears to the human eye. The calculation has three stages, exactly as WCAG defines it:
- Linearize each channel. Each of the red, green, and blue values (0–255) is divided by 255 and then "gamma-corrected" to undo the non-linear way screens encode brightness. Small values are scaled by 12.92; larger ones use
((v + 0.055) / 1.055)^2.4. - Compute relative luminance. The three linear channels are weighted by how sensitive our eyes are to each:
L = 0.2126 × R + 0.7152 × G + 0.0722 × B. Green dominates because the eye is most sensitive to it, which is why two colors with the same "lightness" can have very different luminance. - Form the ratio. With the lighter luminance
L1and darkerL2, the ratio is(L1 + 0.05) / (L2 + 0.05). The+ 0.05accounts for ambient screen glare so the result never divides by zero.
A worked example
Take a common case: gray text #777777 on a white background #FFFFFF. White has a relative luminance of 1.0. Mid-gray #777777 works out to about 0.18. The ratio is (1.0 + 0.05) / (0.18 + 0.05) ≈ 4.56:1. That just clears the AA threshold for normal text (4.5:1) — so this gray is acceptable for body copy, but only barely, and it fails the stricter AAA level (7:1). Darkening the text to #595959 would push it comfortably above AA.
The WCAG thresholds the tool checks
| Level | Minimum ratio | Applies to |
|---|---|---|
| AA Large | 3:1 | Text ≥ 18pt, or ≥ 14pt bold |
| AA Normal | 4.5:1 | Body text — the everyday standard |
| AAA Large | 4.5:1 | Large text, enhanced level |
| AAA Normal | 7:1 | Body text, enhanced level |
"Large" text gets an easier threshold because bigger letters are legible at lower contrast. AA is the level most laws and corporate standards require; AAA is a stretch goal for maximum accessibility.
The automatic suggestion feature
When a pair fails AA normal, the tool searches for a fix. It nudges the foreground darker one step at a time, recomputing the ratio until it crosses 4.5:1, and separately tries lightening the background and lightening the foreground. It then offers the nearest passing colors with their resulting ratios — a practical shortcut when you want to keep your palette close to the original while making it compliant.
Tips and common mistakes
- Contrast is independent of hue. Two vivid colors — say red on green — can look "high contrast" yet have a low luminance ratio and be miserable to read. Always trust the number, not the visual punch.
- Test text over its real background. If text sits on an image or a gradient, check it against the lightest and darkest points it overlaps, not an average.
- Don't rely on color alone. Meeting the ratio helps everyone, but for users who cannot distinguish certain hues, pair color with another cue like an icon or underline.
- Placeholder and disabled text still matter. Faint gray placeholders frequently fail AA. If they convey real information, they need to meet contrast too.
- Larger isn't a loophole. The 3:1 "large text" allowance only applies above the size threshold — shrinking that heading back to body size re-imposes the 4.5:1 rule.
Privacy
The luminance and ratio math runs entirely in your browser. The colors you enter are never sent anywhere, the live preview updates locally, and the tool works with your network disconnected.