Color Converter & Contrast Checker
Convert colors between HEX, RGB, HSL and HSV, plus WCAG contrast ratio checker.
Loading Color Converter & Contrast Checker… If nothing happens, please enable JavaScript.
Frequently asked questions
Is any data sent to a server when I use this tool?
How does the hexadecimal color format work?
When should I use HSL instead of RGB in my CSS?
What WCAG contrast ratio do I need for my website?
Why do the same HSL values sometimes look different in different browsers?
What is the history of web colors?
Can I convert colors with transparency?
How is this tool different from browser DevTools?
Which color values should a developer know by heart?
What is a common beginner mistake with hex colors?
About Color Converter & Contrast Checker
Digital color representation has evolved through several competing systems, each optimised for a different purpose. The hexadecimal #RRGGBB format emerged in the early days of HTML in the 1990s, when Tim Berners-Lee's web needed a concise way to specify the 16 million colors that 24-bit displays could show. The format encodes the red, green, and blue channel intensities as two-digit hexadecimal numbers, making it compact for markup while still being human-parseable. RGB (Red, Green, Blue) is the additive color model used by all digital displays — mixing light at full intensity produces white, which is the opposite of how ink behaves. HSL (Hue, Saturation, Lightness) and HSV (Hue, Saturation, Value) are cylindrical transformations of RGB that align more closely with how humans perceive color, making them indispensable for building systematic design palettes.
Designers use hex codes when writing CSS stylesheets and picking brand colors in tools like Figma or Sketch. Front-end developers switch to RGB or RGBA when they need to apply opacity or perform programmatic color blending in canvas or WebGL. HSL is favoured for generating color scales algorithmically — for example, keeping the hue fixed while stepping the lightness to create a consistent shade ramp. HSV is the native format of most color picker widgets because its value axis maps intuitively to the brightness slider. Accessibility engineers rely on contrast ratio calculations to ensure text remains readable for users with low vision or color blindness, a requirement mandated by WCAG 2.1 and enforced in public sector websites across the EU and US.
This tool converts any color you enter across all four notations simultaneously and also computes the WCAG contrast ratio between your color and any background you specify. Everything runs in your browser with no server requests. You can paste a hex code, type in RGB values, or enter HSL coordinates, and the tool instantly shows you all equivalent representations. The contrast checker gives you a pass or fail result against both the AA and AAA WCAG thresholds.
A common pitfall is confusing HSL and HSV — both use hue and saturation, but their third axis differs in important ways. In HSL, a lightness of 100% always produces white regardless of hue or saturation. In HSV, a value of 100% produces the pure hue (full brightness), not white. Another common mistake is forgetting that hex shorthand #RGB expands to #RRGGBB by doubling digits, so #f09 means #ff0099, not #f00009. When working with opacity, note that CSS accepts both eight-digit hex (#RRGGBBAA) and the rgba() function — but some older browsers and design tools only support the rgba() form.
How 16 Million Colors Ended Up in a Six-Character Code
Before the web, color on computer screens was a matter of severe constraint. The original CGA graphics card from 1981 offered just 16 colors, carefully chosen to be distinguishable on the monitors of the day. The EGA standard expanded this to 64, and VGA eventually offered 256 colors from a fixed palette. It was not until 24-bit true color displays became affordable in the early 1990s that the full 16,777,216-color spectrum became accessible to consumer hardware — and the web needed a notation to describe them all.
Netscape Navigator's engineers chose hexadecimal because it mapped perfectly to the underlying hardware: each of the three 8-bit color channels (0–255) can be expressed as exactly two hex digits (00–FF), giving a compact and unambiguous six-character code. The format appeared in Netscape 1.1 around 1994 and was rapidly copied by Internet Explorer. The W3C formalized it in the CSS1 specification in 1996, cementing its place as the universal shorthand for web color. The named color keywords — red, blue, aqua — were inherited directly from the 16 standard VGA colors, with additional colors drawn from the X11 windowing system used on Unix workstations.
The shift toward perceptually uniform color spaces is the next chapter in web color history. Traditional RGB and HSL are mathematically simple but perceptually non-uniform — a step of ten lightness units in HSL looks very different depending on the hue, which makes reliable accessibility calculations difficult. The CSS Color Level 4 specification introduces OKLCH and OKLAB, color spaces designed so that equal numeric differences correspond to equal perceived differences. These spaces are already supported in modern browsers and represent the most significant evolution in how developers specify color since the original hex format was introduced thirty years ago.