Color Converter - HEX, RGB & HSL Palette Tool

Convert color formats between HEX, RGB, and HSL spaces instantly. Check WCAG contrast ratios on white and black backgrounds in real-time.

Color Converter

Convert colors between HEX, RGB, and HSL, with live preview and quick-copy formats for your design system.

HEX
#F264D8
RGB
242, 100, 216
HSL
311°, 85%, 67%
Contrast Hints
On white
2.77:1
On black
7.59:1
Color Formats
Accepts short or long HEX, with or without '#'.
Saved Swatches
✠- Live Conversion

Instant sync between HEX, RGB, and HSL

✠- Contrast Checker

WCAG contrast ratios for accessibility

✠- Quick Copy

One-click copy for any format

✠- Color Swatches

Save and reuse your palette

Local Color Compilation: Calculations run as purely mathematical transformations locally. Your styling and branding selections remain private.

Color Converter: Master Global Color Formats & Design Tokens

In modern frontend engineering and UI design, managing a unified styling layout requires translating brand colors across different platforms. While graphic design applications naturally output HEX values, styling libraries (such as CSS, Tailwind, or Sass) frequently require RGB channels for opacity blending, or HSL channels for dynamic theming engines.

Evaluating these conversions manually requires complex hex-to-decimal base changes. Our **Color Converter** provides a zero-latency, bi-directional converter workspace, allowing you to update any single channel (HEX, RGB, or HSL) and watch all others synchronize instantly alongside WCAG accessibility metrics.

Formula
Luminance = 0.2126 × R_linear + 0.7152 × G_linear + 0.0722 × B_linear

To determine readability, colors are transformed to relative luminance coordinates. The relative luminance of any sRGB color is determined by scaling the primary color channels:

Contrast Assessment Metrics

Once relative luminance is determined, the contrast ratio is computed. In Web design, this ratio must pass specific WCAG thresholds:

Practical Examples

CSS Channel Formats

  • 1.Hex Code: #F264D8
  • 2.RGB Format: rgb(242, 100, 216)
  • 3.HSL Format: hsl(311, 85%, 67%)
  • 4.Typical Use: Ideal for copy-pasting directly into global style tokens or Tailwind configs.

WCAG Contrast Assessment

  • 1.Contrast Ratio (White bg): 2.77:1 (Low contrast)
  • 2.Contrast Ratio (Black bg): 7.59:1 (Excellent AAA contrast)
  • 3.Action Plan: Safe to use as text on dark theme templates, but must be darkened or reserved for decorative panels on light themes.

Frequently Asked Questions

What is the difference between HEX, RGB, and HSL color models?

HEX and RGB are hardware-oriented color spaces based on additive mixtures of Red, Green, and Blue light. HSL (Hue, Saturation, Lightness) is a human-oriented color space representing colors in terms of their pure tone (hue), richness (saturation), and brightness (lightness).

How is the WCAG contrast ratio calculated?

The Web Content Accessibility Guidelines (WCAG) contrast ratio is calculated using relative luminance values. Relative luminance represents the perceived brightness of a color, normalized between 0 (complete black) and 1 (pure white). The contrast ratio is then: (L1 + 0.05) / (L2 + 0.05), where L1 is the lighter color and L2 is the darker color.

What is a passing WCAG contrast ratio for body text?

Under WCAG 2.1 AA guidelines, normal body text (under 18pt) requires a minimum contrast ratio of 4.5:1 against its background. Large text (above 18pt or 14pt bold) requires at least 3.0:1. The strict AAA compliance standard increases these to 7.0:1 for normal text and 4.5:1 for large text.

Why do UI designers and developers prefer HSL?

HSL is highly intuitive because adjusting shade and tint is straightforward. To create a lighter hover state of a color in HSL, you simply increase the Lightness channel percentage (e.g., from 50% to 60%), whereas in HEX or RGB you would need to calculate complex offsets across all three primary channels.

Does this color converter support offline usage?

Absolutely. The entire bi-directional color parser is compiled locally inside your web browser. No network requests are made, ensuring zero latency and 100% privacy for your proprietary design tokens.