Hex Color Checker

Validate & convert hex color codes

CheckersFreeNo Signup
4.3(160 reviews)
All Tools

Loading tool...

About Hex Color Checker

A complete hex color validation and conversion tool. Enter any color in HEX, RGB, or HSL format and instantly see a live preview, WCAG contrast ratios against white and black backgrounds, complementary and analogous palette suggestions, and conversions to all major color formats. Supports shorthand hex (#FFF), 8-digit hex with alpha (#FF000080), and CSS named colors. Essential for web designers, UI developers, and digital artists working with color systems.

Hex Color Checker Features

  • Live color preview
  • HEX/RGB/HSL/CMYK
  • Contrast ratios
  • Palette generation
  • Alpha channel support
Hex color codes are the universal language of digital color — used in CSS, design tools, and graphics software. A hex code like #3B82F6 encodes the red, green, and blue channels as two-digit hexadecimal values (0-255 each). This checker validates hex codes, shows a live preview, converts to RGB/HSL/CMYK, calculates WCAG contrast ratios, and generates harmonious color palettes.

How to Use the Hex Color Checker

Enter a hex color code with or without the # prefix:

  • Live preview — see the exact color rendered
  • Format conversions — HEX, RGB, HSL, and CMYK values
  • Contrast ratios — WCAG AA/AAA compliance against black and white
  • Palette — complementary, analogous, and triadic colors

Also accepts RGB (rgb(59,130,246)) and HSL (hsl(217,91%,60%)) inputs.

Understanding Hex Color Format

A hex color code uses base-16 notation:

  • #RGB — shorthand (e.g., #F00 = #FF0000 = red)
  • #RRGGBB — standard 6-digit format
  • #RRGGBBAA — 8-digit with alpha transparency

Each pair ranges from 00 (0) to FF (255). The channels are Red, Green, Blue in that order.

Color Contrast & Accessibility

WCAG 2.1 defines minimum contrast ratios for accessibility:

  • AA Normal text: 4.5:1 contrast ratio
  • AA Large text: 3:1 contrast ratio
  • AAA Normal text: 7:1 contrast ratio

This tool calculates the relative luminance and contrast ratio against both white and black backgrounds.

Step-by-Step Instructions

  1. 1Enter a hex color code (e.g., #3B82F6 or 3B82F6).
  2. 2View the live color preview swatch.
  3. 3Check RGB, HSL, and CMYK conversion values.
  4. 4Review WCAG contrast ratios for accessibility compliance.
  5. 5Explore the generated color palette for harmonious combinations.

Hex Color Checker — Frequently Asked Questions

What's the difference between 3-digit and 6-digit hex codes?+

A 3-digit hex code is shorthand where each digit is doubled: #F0A expands to #FF00AA. The 6-digit form gives you full control with 16.7 million possible colors (256 × 256 × 256). Use shorthand only when each channel's two hex digits are identical.

How do I add transparency to a hex color?+

Add two more hex digits after the color: #FF000080 is red at 50% opacity. The alpha channel ranges from 00 (fully transparent) to FF (fully opaque). Note that 8-digit hex is supported in modern browsers but not in older ones — use rgba() for wider compatibility.

How is the contrast ratio calculated?+

The WCAG contrast ratio uses relative luminance: (L1 + 0.05) / (L2 + 0.05), where L1 is the lighter color's luminance. Luminance is calculated from sRGB values using the formula: 0.2126 × R + 0.7152 × G + 0.0722 × B, with each channel linearized using the sRGB transfer function.

Share this tool: