Color Converter & Contrast Checker

Convert between HEX, RGB, and HSL color notations, preview swatches, and inspect WCAG 2.1 accessibility contrast compliance for web design.

Tier 1: Browser Native WCAG 2.1 Verified Instant Conversion

Click swatch above to open system color picker

WCAG 2.1 Accessibility Contrast Assessment

On White (#ffffff) 4.85:1
Sample text rendered with this color.
On Black (#000000) 4.33:1
Sample text rendered with this color.

What This Tool Does & Problem It Solves

The Color Converter & Contrast Checker transforms color codes between HEX, RGB, and HSL formats and evaluates WCAG 2.1 AA/AAA contrast ratios against light and dark backgrounds. It ensures your web designs are beautiful, compliant, and accessible to all users.

Step-by-Step Instructions

  1. Enter a color code in HEX, RGB, or HSL format, or click the visual color picker.
  2. View simultaneous conversions across HEX, RGB, HSL, and CSS color representations.
  3. Inspect the WCAG Accessibility Contrast ratings against pure white (#FFFFFF) and pure black (#000000).
  4. Click "Copy" next to any format to use it in your CSS stylesheets.

Common Practical Use Cases

  • Web Accessibility Compliance (WCAG): Verify that button text and UI headings achieve at least a 4.5:1 contrast ratio to pass WCAG AA standards.
  • CSS & Frontend Development: Convert brand HEX colors from design files into flexible HSL values for theme variations.
  • Palette Harmony & Shading: Adjust color lightness and saturation percentages while keeping the base hue identical.

Realistic Example & Expected Output

Example Input
HEX: #3b82f6 (Tailwind Blue)
Expected Output
RGB: rgb(59, 130, 246) | HSL: hsl(217, 91%, 60%) | Contrast on White: 3.52:1 (Fails AA Normal Text, Passes AA Large Text)

Technical Specifications & Mechanics

Conversions compute normalized RGB coordinates and cylindrical HSL coordinates. Relative luminance is calculated per W3C WCAG 2.1 specifications: $L = 0.2126R + 0.7152G + 0.0722B$ where RGB values are linearized.

Limitations & Browser Boundaries

Operates in standard sRGB color space; wide-gamut Display P3 or CMYK print profiles are not modeled.

Privacy & Security Guarantee

100% in-browser processing. Zero network requests.

Frequently Asked Questions

What is the minimum WCAG contrast ratio for body text?

WCAG 2.1 Level AA requires a contrast ratio of at least 4.5:1 for normal body text and 3:1 for large text (18pt or 14pt bold).

Why is HSL useful in web design?

HSL (Hue, Saturation, Lightness) makes it easy to create hover states and tints by adjusting only the lightness percentage.

Can I paste 3-digit HEX colors like #fff?

Yes. 3-digit HEX shortcuts are automatically expanded into standard 6-digit representations.