HEX, RGB, HSL & OKLCH Color Converter + WCAG Checker
Convert any color seamlessly between HEX (`#RRGGBB`), `rgb()`, `hsl()`, modern CSS Color 4 `oklch()`, print `cmyk()`, and CSS named colors. Preview live swatches and verify WCAG 2.1 AA / AAA contrast ratios against white, black, or any custom background directly in your browser.
#How to Use This Tool
#Mathematical Formula & Standards
#Edge Cases & Technical Considerations
Why OKLCH Beats HSL for UI Design Systems
HSL lightness is not perceptually uniform—yellow (`hsl(60, 100%, 50%)`) looks far brighter to the human eye than blue (`hsl(240, 100%, 50%)`). OKLCH keeps perceived lightness (`L`) consistent across all hues (`H`).
sRGB Gamut Clamping
Wide-gamut OKLCH colors with high chroma (`C`) outside the sRGB gamut are clamped channel-wise when converted to 8-bit HEX and `rgb()`.
WCAG 2.1 AA vs. AAA Thresholds
WCAG AA requires `4.5:1` for normal body text (`3.0:1` for large text >= 18pt or 14pt bold). WCAG AAA raises the bar to `7.0:1` for normal text and `4.5:1` for large text.
#Frequently Asked Questions
Q:What color formats can I paste into the input?
You can paste 3/6/8-digit HEX (`#10B981`, `#f00`), `rgb(...)`, `hsl(...)`, CSS Color 4 `oklch(L C H)`, or standard CSS color names like `coral`, `teal`, and `rebeccapurple`.
Q:How is WCAG 2.1 contrast ratio calculated?
The engine linearizes sRGB channels, computes relative luminance (0 for black, 1 for white), and divides `(L_lighter + 0.05) / (L_darker + 0.05)` to evaluate AA and AAA thresholds.
Q:Are my design tokens or brand colors sent to a server?
No. All color space conversions and contrast calculations run 100% client-side in your browser.
Have feedback or feature requests?
Help us improve this utility. Share suggestions, report edge cases, or request new features directly.
#Related Utilities
Explore complementary tools running on-device with zero server upload.
Code to Image Studio — Beautiful Code Snippet Visualizer
Turn raw code snippets into stunning, shareable graphics in seconds. Choose from vibrant syntax themes (Dracula, Nord, Monokai, GitHub Dark, Synthwave, Regula Emerald), customize background gradients, toggle macOS window controls, and export crisp PNG or vector SVG images directly to your clipboard or disk without uploading a single byte to any server.
App Icon Generator & Favicon Studio (iOS, Android, PWA)
Production-ready app icon and favicon generator for mobile and web developers. Instantly generate pixel-perfect assets across Apple iOS, Google Play Android, and PWA standards with 100% client-side Canvas and zero server upload privacy.
Privacy-First Image Cropper, Resizer & Squircle Studio
Zero-upload client-side image transformation studio. Crop images with fixed aspect ratios, apply continuous Apple squircle curves or circular masks, and export high-resolution WebP, PNG, or JPEG assets without transmitting your private photos or design assets across the internet.