calculatorkong

Color Converter

Aa Aa

Contrast vs white text

Contrast vs black text

Color notations
#RRGGBB = one byte per channel · HSL = hue° + saturation% + lightness%

Every screen color is three bytes — red, green, blue — but developers and designers read those bytes in different dialects. This converter keeps HEX, RGB and HSL in sync, with a live swatch and the accessibility check most color tools forget.

The three notations

HEX (#3B82F6) is the compact web-native form: two hex digits per channel, shorthand #abc doubling to #aabbcc. RGB spells the same bytes in decimal — rgb(59, 130, 246). HSL reorganizes them for humans: hue on the 0–360° color wheel, saturation, lightness — so "same blue, lighter" is a single number edit instead of hex surgery.

Contrast: the check that matters

WCAG accessibility guidelines require text contrast of 4.5:1 (AA) against its background — the difference between readable and squint-worthy for millions of users. The two badges rate your color as a background under white and black text using the official relative-luminance formula; ✓ AA means normal text passes, "(large only)" means 3:1 headline territory.

Why HSL earns its place

Design systems build palettes by holding hue fixed and stepping lightness — exactly what HSL exposes. A 10-shade blue ramp is one hue, ten lightness values. Complementary colors sit 180° apart on the hue wheel; triads at 120°. None of that is visible in hex.

Neighbors in the toolbox

Hex digits themselves — why B is 11 and F is 15 — unfold in the number base converter; byte-level encodings in the binary translator. Screen dimensions to go with your colors: the aspect ratio calculator.

Opaque colors (no alpha); WCAG 2.x contrast math.

Frequently Asked Questions

How do I convert HEX to RGB? +

Split the hex into byte pairs and read each as a number: #3B82F6 → R=0x3B=59, G=0x82=130, B=0xF6=246 → rgb(59, 130, 246).

What is HSL and why use it? +

Hue (0–360° on the color wheel), Saturation and Lightness. It matches how people think about color — “same blue, a bit lighter” is one HSL number away but a mystery in hex.

What does #abc shorthand mean? +

Three-digit hex doubles each digit: #abc = #aabbcc. This converter accepts both forms, with or without the # prefix.

How many colors can hex represent? +

256³ = 16,777,216 — every combination of a byte each for red, green and blue. Human eyes distinguish maybe 10 million, so 24-bit color effectively covers perception.

What is WCAG color contrast? +

Accessibility guidelines require text-to-background contrast of at least 4.5:1 (AA, normal text) or 3:1 for large text. This converter shows the ratio of your color against black and white text.

Does this support alpha (transparency)? +

This tool covers opaque colors — the 6-digit hex and rgb() forms. Alpha adds a fourth channel (#RRGGBBAA, rgba()); the underlying math is identical with one more byte.

Powered by Calculator Kong ↗

Related Calculators