Color Contrast Checker

Evaluate foreground and background color combinations against WCAG 2.1 and 2.2 accessibility standards in real time.

Enter two HEX, RGB or HSL colors to preview text and controls. The checker compares the computed ratio with the applicable WCAG thresholds.

✓ 100% Free Utility✓ Client-Side Evaluation✓ Zero Server Uploads✓ WCAG Contrast Thresholds✓ Instant Ratio Calculation✓ No Account Required
⚡ In-browser processing100% FreeNo Account Required
Loading calculator…

Rate Color Contrast Checker

Feedback

Save a personal rating in this browser.

Choose a rating

How to use Color Contrast Checker

  1. 1Input the Foreground Color: Enter the hexadecimal, RGB, or HSL color string for your typography or vector icon into the foreground color field, or use the color picker input to choose a tone.
  2. 2Assign the Background Color: Input the color code representing the background container, canvas, or button fill to render an immediate visual preview of the typographic combination.
  3. 3Inspect the Calculated Contrast Ratio: Review the computed numerical contrast ratio, ranging from 1:1 to 21:1, derived using standardized W3C relative luminance formulas.
  4. 4Validate WCAG Conformance Levels: Inspect the compliance results panel to verify whether your color combination satisfies Level AA and Level AAA requirements across normal body text, large typography, and non-text visual user interface components.

Key Features & Highlights

  • •Real-Time Relative Luminance Evaluation: The tool calculates contrast using the standardized W3C relative luminance algorithm, mapping non-linear sRGB values to linear photometric brightness without mathematical rounding shortcuts.
  • •Comprehensive Multi-Format Parsing: Users can input color definitions across HEX (#FFFFFF, #FFF), RGB (rgb(255, 255, 255)), or HSL (hsl(0, 0%, 100%)) notations. The parser normalizes all inputs in browser memory.
  • •WCAG AA and AAA Thresholds: See whether the color pair meets each contrast criterion for the selected element.
  • •Typographic and Component Size Differentiation: The utility categorizes compliance across three critical thresholds: Normal Text (<18pt / <14pt bold), Large Text (≥18pt or ≥14pt bold), and Non-Text UI components (buttons, borders, and input fields).
  • •Fine-Tuning Lightness Controls: Interactive lightness chip buttons allow designers to adjust baseline tones incrementally (+/- 5%) until failing combinations achieve passing compliance thresholds.
  • •One-Click Inversion Testing: A swap button instantly reverses the foreground and background color values, enabling rapid testing for dark mode color system parity.
  • •Pure Client-Side Data Privacy: All color conversions and luminance calculations execute within the client's local browser environment. Zero color strings, hex codes, or telemetry logs transmit to remote servers.
Quick summary

For WCAG AA, normal text needs at least 4.5:1 and large text needs at least 3:1. Black text on white has a ratio of 21:1. Enter the foreground and background you actually use to check the pair.

What contrast ratio does WCAG require?

WCAG AA requires a ratio of at least 4.5:1 for normal text and 3:1 for large text. The enhanced AAA text thresholds are 7:1 and 4.5:1, respectively. For example, #767676 on white gives about 4.54:1 and passes AA for normal text. #777777 on white gives about 4.48:1 and falls below that threshold.

For controls such as an input boundary or a focus indicator, test the colors that actually touch in the relevant state. Use the WCAG contrast guide for text, controls and gradients when checking several states across a design.

Accessibility Compliance Scope & Limitations: This utility specifically evaluates color contrast under WCAG 2.1 and 2.2 Success Criteria 1.4.3 (Contrast Minimum), 1.4.6 (Contrast Enhanced), and 1.4.11 (Non-text Contrast). Achieving a passing contrast ratio is essential, but it does not prove or guarantee that an entire webpage meets complete web accessibility compliance. Comprehensive accessibility also requires keyboard navigation, semantic HTML landmarks, screen reader compatibility, accessible focus indicators, and touch target sizing.

The W3C Relative Luminance Calculation Engine

The World Wide Web Consortium (W3C) defines relative luminance (L) as the photometric brightness of any point in a colorspace, normalized to 0.0 for absolute black and 1.0 for absolute white. To calculate contrast accurately, the algorithm maps 8-bit non-linear sRGB values to linear photometric energy:

Step 1: sRGB Channel Normalization
V = C_srgb / 255

Each Red, Green, and Blue component is mapped to a decimal value between 0.0 and 1.0.

Step 2: Gamma Expansion (De-linearization)
if V <= 0.04045: C_linear = V / 12.92 else: C_linear = ((V + 0.055) / 1.055) ^ 2.4

Removes digital display gamma compression to measure physical photometric radiance.

Step 3: Human Spectral Sensitivity & Final Ratio
L = (0.2126 × R_linear) + (0.7152 × G_linear) + (0.0722 × B_linear)
Contrast Ratio = (L1 + 0.05) / (L2 + 0.05)

Where L1 is the relative luminance of the lighter shade and L2 is that of the darker shade. The constant 0.05 accounts for ambient light flare on physical displays and prevents division by zero. Ratios span from 1:1 (identical shades) to 21:1 (pure black on pure white).

WCAG 2.1 & 2.2 Conformance Matrix (Success Criteria 1.4.3, 1.4.6 & 1.4.11)

The Web Content Accessibility Guidelines establish distinct minimum contrast ratios according to element scale and functional role:

Visual Element CategorySize & Weight ThresholdLevel AA MinimumLevel AAA EnhancedPrimary Success Criterion
Normal Body TextUnder 18pt (24px) or under 14pt (18.66px) bold4.5:17.0:1SC 1.4.3 / SC 1.4.6
Large Scale TextAt least 18pt (24px) regular or at least 14pt (18.66px) bold3.0:14.5:1SC 1.4.3 / SC 1.4.6
User Interface ComponentsActive buttons, input borders, toggles, focus rings3.0:1N/A (Defaults to 3.0:1)SC 1.4.11 (Non-text)
Graphical ObjectsStandalone iconography, chart lines, infographic glyphs3.0:1N/A (Defaults to 3.0:1)SC 1.4.11 (Non-text)
Incidental or DecorativeInactive disabled controls, pure decoration, brand logotypesExemptExemptSC 1.4.3 / SC 1.4.11

Technical Comparison: BrivTools vs. Alternative Solutions

How BrivTools compares against traditional web checkers, desktop applications, and design tool plugins:

Functional Evaluation MetricBrivTools Online CheckerLegacy Web CheckersNative Desktop AppsDesign Tool Plugins
Execution ArchitectureClient-Side JavaScript / Web APIsServer-Side HTTP RequestsLocal Desktop Binary (.exe / .dmg)Sandboxed Plugin Engine
Runtime Latency< 1ms (Instant Local DOM)300ms–800ms Network Round-Trip< 5ms Local Memory50ms–200ms Host App API
Installation RequirementZero (Instant Browser Access)Zero (Browser Access)Mandatory Local InstallationMandatory Host App (Figma, Sketch)
Data Privacy & Telemetry100% In-Memory (Zero Uploads)Server Query Parameter LoggingLocal File-System AccessAccount-Linked Usage Analytics
Subscription Cost100% Free ForeverFree with Ad ClutterFree / Open-SourceFree Tier / Paid Enterprise Seats
Non-Text Contrast (1.4.11)Fully Supported (UI Controls)Frequently OmittedSupportedPartially Supported
Responsive Mobile UtilityFull Mobile Touch OptimizationUnoptimized Mobile ViewportsDesktop Only (No Mobile)Desktop Only (No Mobile)

Connected Design System & Accessibility Utilities

Building a resilient, accessible design system involves more than text contrast. For an exhaustive breakdown of mathematical thresholds, non-text UI exceptions, and legal compliance under ADA Title III and Section 508, read our in-depth WCAG 2.2 Color Contrast Accessibility Guide. You can also explore complementary developer utilities across the BrivTools suite: extract hex codes directly from mockups using the Image Color Picker, test multi-stop background ramps with the CSS Gradient Generator, optimize clean iconography through the SVG Optimizer, and compress interface graphics via the Image Compressor.

Processing and privacy

This tool processes its inputs in your browser. Supported inputs and practical limits depend on the tool and your device.

Frequently Asked Questions

Common questions about Color Contrast Checker usage, file handling, security, and limits

Is this a color contrast checker or a colour contrast analyzer?+

Both — they are different names for the same tool. 'Color contrast checker', 'colour contrast checker' (British spelling), and 'colour contrast analyser' all describe a tool that measures the WCAG contrast ratio between a foreground and background colour. This tool performs that analysis in real time for any hex, RGB, or HSL colour pair.

How does this color contrast checker calculate the ratio between colors?+

The tool evaluates color contrast using the W3C relative luminance formula. It translates hexadecimal, RGB, or HSL inputs into linear photometric values by removing display gamma. The calculator then divides the relative luminance of the lighter shade (L1 + 0.05) by that of the darker shade (L2 + 0.05) to generate an exact ratio between 1:1 and 21:1.

What contrast ratio does WCAG 2.1 Level AA require for standard body text?+

WCAG 2.1 Level AA Success Criterion 1.4.3 requires a minimum contrast ratio of 4.5:1 for standard body text, which includes any typeface smaller than 18 points (24px) regular or 14 points (18.66px) bold.

What constitutes large text under web accessibility guidelines?+

Large text is defined as typography measuring at least 18 points (24 pixels) at regular font weight, or at least 14 points (approximately 18.66 pixels) with a bold weight. Large text requires a 3.0:1 minimum contrast ratio for WCAG Level AA.

Why do graphical icons and button borders require a 3:1 contrast ratio?+

Under WCAG Success Criterion 1.4.11 (Non-text Contrast), visual elements required to identify active user interface components—such as form borders, checkboxes, and navigation icons—must maintain at least a 3.0:1 contrast ratio against adjacent backgrounds to remain perceivable.

Does this tool upload colors or design tokens to a remote server?+

No. The BrivTools contrast checker runs calculations entirely within the browser's local JavaScript runtime. No color codes, palette selections, or telemetry data transfer to external cloud servers, guaranteeing complete privacy for proprietary design systems.

Can designers achieve compliance by rounding up a ratio of 4.48:1 to 4.5:1?+

No. WCAG conformance thresholds represent absolute mathematical minimums. A contrast ratio of 4.48:1 fails Success Criterion 1.4.3. Colors must be adjusted until the calculated ratio equals or exceeds 4.50:1 precisely.

Are brand logos exempt from WCAG color contrast requirements?+

Yes. Text or icons that form an integral part of a brand logotype or trademark are explicitly exempt from WCAG contrast thresholds under Success Criteria 1.4.3 and 1.4.11. Accessibility guidelines nevertheless recommend pairing logotypes with high-contrast containers to optimize legibility.

How do dark mode interfaces impact color contrast evaluation?+

Dark mode transitions require separate contrast checks. While pure black and white retain a 21:1 ratio when inverted, intermediate tones shift significantly in perceived luminance against dark backgrounds and must be verified independently to ensure both themes pass compliance criteria.

Learn the workflow

Understand WCAG contrast thresholds

Related Free Utilities

Tools for related tasks

View all tools →