BrowserLeaksUSBrowserLeaksUS

Color Converter

Convert between HEX, RGB, HSL with live preview - fully client-side

Preview

hex#3B82F6
rgbrgb(59, 130, 246)
hslhsl(217, 91%, 60%)
rgbargba(59, 130, 246, 1)
tailwind#3b82f6
css--color: #3b82f6;

HEX

RGB

R
G
B

HSL

H
S
L

What this tool does

Converts color values between HEX, RGB, RGBA, HSL, HSLA, HSV, CMYK, and CSS named colors. Live color picker, eyedropper for real-time preview, WCAG contrast checker against black and white backgrounds.

Who it's for: Designers, front-end developers, and accessibility auditors verifying WCAG contrast ratios.

When to use

  • •Convert a design HEX to HSL for programmatic tweaks.
  • •Check if a button's color has sufficient contrast for WCAG AA.
  • •Match a CSS named color to its HEX equivalent.
  • •Generate RGBA variants with specific opacity.

How it works

  1. 1Enter a color in any format (HEX, rgb(), hsl(), name).
  2. 2All other formats display instantly.
  3. 3Contrast score against black/white is shown.
  4. 4Visual preview updates in real time.

Tips

  • •WCAG AA requires 4.5:1 contrast for normal text, 3:1 for large.
  • •HSL is easier for programmatic manipulation (shift hue, lightness).
  • •CSS named colors (140 total) are case-insensitive.

Using this result

How to read a color conversion

01

One color, several notations

The swatch is the color you entered, drawn in the page. HEX, RGB, HSL, and the other fields are the same color in different notations, not different colors. HEX is what CSS and design tools expect, usually as #RRGGBB. A #RGB shorthand expands each digit, so #abc is #aabbcc. RGB lists red, green, and blue from 0 to 255. HSL lists hue as a degree, then saturation and lightness as percentages. Changing any one field recomputes the others. If they ever disagree, trust the last field you edited and the swatch.

Alpha is the odd field. HEX with eight digits and rgba() carry transparency. A conversion that drops the alpha will look more solid than your source. Check the alpha readout before you copy a value into a stylesheet. The eye dropper and the palette, when you use them, only set the current color. They do not save a theme.

02

Contrast is not in the numbers

Two colors can be numerically close and still one of them fails contrast on a white card, or the reverse. This page converts. It does not certify WCAG contrast. Read lightness in HSL as a rough guide: values near 0 or 100 are the extremes, and a lightness around 50 is where hue is easiest to see. A gray is a color whose saturation is 0. If saturation is 0 and the swatch is still tinted, the field has not updated.

Copy the notation your codebase already uses. Mixing #hex and hsl() for the same token is how themes drift. If you are generating a palette for a page that also sets prefers-color-scheme, check the result against the CSS Media Queries report on this browser so you know whether the visitor is even in dark mode.