Color Converter & WCAG Contrast Checker — HEX, RGB, HSL, CMYK
Convert colors bidirectionally between HEX, RGB, HSL, and CMYK with a live color picker and built-in WCAG 2.1 AA/AAA contrast ratio checker.
Color Converter
How to Use This Tool
- 01 Click the large color swatch to open your native color picker, click a quick preset circle, or type any 3- or 6-digit HEX code (such as #4F46E5 or #09F).
- 02 Adjust any numeric field inside the RGB (0–255), HSL (H 0–360°, S/L 0–100%), or CMYK (0–100%) cards to convert bidirectionally in real time.
- 03 Click Copy on any card to grab the exact CSS-ready string (HEX, rgb(), hsl(), or cmyk()) for your stylesheet or design tool.
- 04 Scroll to the WCAG 2.1 Contrast Checker below to pick a Foreground (Text) and Background color, or click "Use converter color" to pull in your active swatch.
- 05 Review the Contrast Ratio readout, the four AA/AAA Pass/Fail badges for normal and large text, and the live typography preview box.
How It Works
Practical Examples
Converting Brand Indigo Across Web & Print Formats
HEX: #4F46E5
RGB: rgb(79, 70, 229) • HSL: hsl(243, 75%, 59%) • CMYK: cmyk(66%, 69%, 0%, 10%)
Designers can hand off the CMYK values for brochures while developers paste the exact HEX or HSL tokens into CSS variables.
Checking White Text on an Indigo Primary Button
Foreground: #FFFFFF • Background: #4F46E5
Contrast Ratio: 6.29:1 • AA Normal: PASS • AA Large: PASS • AAA Large: PASS • AAA Normal: FAIL
A 6.29:1 ratio exceeds the WCAG 2.1 AA threshold (4.5:1) for body text and AAA (4.5:1) for large text, making it accessible for buttons and headings.
Spotting Low-Contrast Placeholder Text
Foreground: #94A3B8 • Background: #FFFFFF
Contrast Ratio: 2.56:1 • AA Normal: FAIL • AA Large: FAIL
Light slate text on white falls below even the 3.0:1 large-text minimum. Darkening the foreground to #64748B raises contrast to 4.76:1 (AA Pass).
Tips & Best Practices
- Use HSL when building UI hover states: lowering Lightness (L) by 6–10% creates a natural darker button hover without changing the brand hue.
- WCAG defines "Large Text" as at least 18pt (24px) regular weight or 14pt (18.66px) bold weight.
- Always aim for at least WCAG AA (4.5:1) for body paragraphs, form labels, and navigation links, and 3.0:1 for large display headings and UI icons.
- Because CMYK uses subtractive ink and sRGB uses additive light, bright neon screen colors may look slightly muted when printed—always request a physical proof for critical print runs.
- Use the Swap FG / BG button to quickly verify whether your color pair works equally well in inverted badges or dark mode.
Frequently Asked Questions
What is the difference between WCAG AA and AAA contrast levels?
WCAG 2.1 Level AA requires at least 4.5:1 contrast for normal text and 3.0:1 for large text (24px regular or 18.66px bold). Level AAA is stricter, requiring 7.0:1 for normal text and 4.5:1 for large text.
Why does converting RGB to CMYK and back sometimes shift values by 1?
RGB uses 0–255 integers while CMYK uses 0–100% integers. Rounding between integer ranges can occasionally shift a channel by ±1, which is visually imperceptible.
Can I enter 3-digit shorthand HEX codes like #F0A?
Yes. Shorthand 3-digit HEX values are automatically expanded to their 6-digit equivalents (#FF00AA) and converted into RGB, HSL, and CMYK.
When should I use HSL instead of HEX or RGB in CSS?
HSL is ideal for creating consistent color palettes, dark-mode surfaces, and hover/active states because you can adjust Saturation or Lightness independently while keeping the exact same Hue.
Does this tool store or upload any colors or palettes?
No. Every conversion and contrast calculation runs 100% locally in your web browser with zero network requests.
Related Tools
QR Code Generator
Generate scannable QR codes for URLs, Wi-Fi networks, plain text, and email directly in your browser. Customize colors, error correction, and download SVG or PNG.
Unit Converter
Convert length, weight, temperature, data storage, and speed units instantly in both directions with a live quick-reference conversion table.
Video Compressor
Compress MP4, WebM, and MOV videos to fit Discord (10 MB), WhatsApp (16 MB), Email (25 MB), or any custom target size directly in your browser with zero uploads.
Video to Audio
Extract clean 16-bit PCM WAV audio from MP4, WebM, and MOV videos 100% in your browser. Choose 44.1 kHz, 22.05 kHz, or 16 kHz and Stereo or Mono with zero uploads.