Art of Codeartofcode
BlogToolsShopGames ArenaJobsLive Courses
  • Home
  • Blog
  • Shop
  • Jobs
  • My Zone

Tools

Color Converter & WCAG Contrast Checker

Convert colors between every CSS format, check WCAG contrast, generate shade scales and simulate color blindness.

Convert between HEX, RGB, HSL, HWB, Lab, LCH, OKLab, OKLCH and Display P3, check WCAG contrast with fix-it suggestions, find the nearest Tailwind color, generate a shade scale, and preview color blindness. Everything runs in your browser — nothing is uploaded.

Color converter

100%
Nearest Tailwind: emerald-600 (ΔE 2.3) — bg-emerald-600 / text-emerald-600

alpha

on white

on dark

HEX
#009b65
RGB
rgb(0 155 101)
RGBA (legacy)
rgb(0, 155, 101)
HSL
hsl(159.1deg 100% 30.4%)
HWB
hwb(159.1deg 0% 39.2%)
Lab
lab(56.37% -46.16 18.24)
LCH
lch(56.37% 49.63 158.44)
OKLab
oklab(0.60829 -0.12946 0.04743)
OKLCH
oklch(0.60829 0.13787 159.88)
Display P3
color(display-p3 0.2676 0.5986 0.4131)

Contrast checker

3.57:1

AA NormalAA LargeAAA NormalAAA LargeUI 3:1

The quick brown fox jumps over the lazy dog.

Large heading text

Fails AA — normal text (4.5:1) — try one of these instead

Shade scale

Export
:root {
  --color-brand-50: #e9fff2;
  --color-brand-100: #c3ffdd;
  --color-brand-200: #83fabe;
  --color-brand-300: #6be3a8;
  --color-brand-400: #42bf86;
  --color-brand-500: #16a26b;
  --color-brand-600: #008757;
  --color-brand-700: #006c45;
  --color-brand-800: #005636;
  --color-brand-900: #00472c;
  --color-brand-950: #002c1a;
}

Protanopia (no red)

Sample text on this background

Contrast: 3.28:1

Deuteranopia (no green)

Sample text on this background

Contrast: 3.81:1

Tritanopia (no blue)

Sample text on this background

Contrast: 3.53:1

Achromatopsia (no colour)

Sample text on this background

Contrast: 3.57:1

About Color Converter & Contrast Checker

Picking colors that look good is easy; picking colors that also meet accessibility standards is harder. This tool parses any CSS color format you throw at it, converts it to every other format at once, and pairs that with a full WCAG 2.1 contrast checker that suggests a passing foreground or background when your pair fails. It also finds the nearest Tailwind color, builds an evenly-spaced OKLCH shade scale you can export as CSS variables or a Tailwind theme, and simulates protanopia, deuteranopia, tritanopia and achromatopsia so you can see your palette the way some of your users will.

Features

Every CSS colour format

Parses hex, rgb, hsl, hwb, lab, lch, oklab, oklch, color() and all 148 named colours, and converts between all of them.

WCAG contrast checker

Live contrast ratio with all five AA/AAA pass-fail badges, alpha compositing, and a real text/button preview.

"Fix it" suggestions

When a pair fails your target ratio, get the nearest passing foreground and background, found by walking OKLCH lightness.

Shade scale generator

Generate a 50–950 OKLCH shade scale from any colour, with contrast against white and black, exported as CSS variables, Tailwind v4 @theme, or SCSS.

Colour-blindness simulation

Preview your foreground/background pair under protanopia, deuteranopia, tritanopia and achromatopsia, with the simulated contrast ratio.

Private share links

Copy a link that carries your colour, foreground and background in the URL hash. Nothing is sent to a server.

How to use Color Converter & Contrast Checker

  1. 1

    Enter a color

    Type or paste any CSS color - hex, rgb, hsl, hwb, lab, lch, oklab, oklch, color() or a named color - or pick one with the eyedropper.

  2. 2

    Read every format at once

    The tool converts your color to all other formats instantly, each with a one-click copy button.

  3. 3

    Check contrast

    Set a foreground and background to see the WCAG 2.1 ratio and pass/fail badges for AA, AAA and UI components.

  4. 4

    Apply a fix if it fails

    When a pair fails your target ratio, use the suggested passing foreground or background found by walking OKLCH lightness.

  5. 5

    Generate a shade scale

    Build a 50-950 OKLCH shade scale from your color and export it as CSS variables, a Tailwind v4 theme, or SCSS.

Use cases

  • Checking a brand color pair against WCAG AA before it ships
  • Converting a hex value from a design file into the OKLCH your Tailwind theme expects
  • Building a full 50-950 shade scale from a single brand color
  • Matching a picked color to the closest Tailwind utility class
  • Previewing a palette under color blindness before finalizing a design system

Privacy

Every conversion, contrast check and simulation runs in your browser. Nothing about the colors you enter is uploaded, and share links store the color values only in the URL hash.

Frequently asked questions

HEX and RGB are the most widely supported and best for copy-pasting into design tools. HSL is easiest to reason about by hand (hue, saturation, lightness). OKLCH is the newest and the one worth reaching for when you need to programmatically generate palettes or shades — unlike HSL, equal steps in OKLCH lightness actually look equally spaced to the eye, which is why the shade scale generator builds on it.
They are the two conformance levels in the Web Content Accessibility Guidelines for color contrast. AA is the baseline most sites and regulations require; AAA is a stricter, optional level for higher-contrast content. Both have separate thresholds for normal-size and large text.
For AA: 4.5:1 for normal text, 3:1 for large text (18pt+/24px+, or 14pt/19px bold). For AAA: 7:1 for normal text, 4.5:1 for large text. UI components and graphical objects (like icons and input borders) need 3:1 against their surrounding background.
HSL lightness is perceptually uneven — hsl(60, 100%, 50%) (yellow) and hsl(240, 100%, 50%) (blue) have the same "L" value but look nowhere near equally bright. OKLCH lightness tracks how bright a color actually looks, so a shade scale built by stepping OKLCH lightness at a fixed hue and chroma reads as a smooth, even ramp instead of jumping unpredictably.
Every color in Tailwind v4's default palette (22 hues x 11 shades, plus black and white) is compared to your color using CIEDE2000, the most perceptually accurate color-difference formula in common use. The palette entry with the smallest ΔE wins — a ΔE near 0 means an exact or near-exact match, and anything under about 2 is generally indistinguishable to the eye.
Yes. Alongside format conversion and contrast checking, it simulates protanopia, deuteranopia, tritanopia and achromatopsia so you can preview your foreground/background pair the way some visitors will actually see it, with the simulated contrast ratio shown alongside.

Related tools

Gradient Generator

Free online CSS gradient generator with live preview. Create beautiful linear, radial, and conic gradients. Customize colors, angles, and color stops. Copy CSS code with one click. No signup required.

Box Shadow Generator

Free online CSS box shadow generator with live preview. Create beautiful shadows with visual controls. Support for multiple shadows, inset shadows, and presets.

Pick One

Free online Pick One tool with live preview. Create stunning side-by-side A/B comparisons with customizable layouts, labels, backgrounds, and aspect ratios. Perfect for social media polls.

Developed by MadMVP

Book a call to build your vision into reality
Art of Codeartofcode

The den of devs. Stories, tools, games, and gear for developers.

Platform

  • Blog
  • Tools
  • Games Arena
  • Shop
  • Learning
  • Campus

Company

  • About Us
  • Jobs & Internships
  • Contact

Legal

  • Terms of Service
  • Privacy Policy
  • Refund Policy
Copyright © 2026 artofcode.in, All Rights Reserved.