About Color Converter
The Color Converter is a free online color converter that keeps HEX, RGB and HSL in sync — change any one of them and the other two, plus a live swatch, update immediately. Type a value directly, or pick visually with the built-in color picker; the tool also runs a hex to rgb and rgb to hex conversion automatically as you type, so you never have to do the arithmetic by hand.
HEX (#3b82f6) is the compact format used in CSS and design handoffs, RGB (rgb(59, 130, 246)) is what canvas APIs and many image libraries expect, and HSL (hsl(217, 91%, 60%)) describes a color by hue, saturation and lightness — the format designers reach for when they want to nudge a color lighter, darker or more saturated without changing its hue. Converting between all three by hand is tedious and easy to get wrong; this tool makes it a copy-paste job while showing the actual rendered color so you can confirm it's right before it goes into code.
Below the converter sits a built-in WCAG contrast checker: it computes the contrast ratio of your current color against pure white and pure black text (and vice versa), using the same relative-luminance formula from the WCAG 2.x spec, and labels each result AAA, AA or Fail. That's directly useful for accessibility work — picking a background color and immediately seeing whether white or black text will actually be legible on it, without switching to a separate contrast tool.
Every calculation — the HEX/RGB/HSL conversion and the contrast math — runs locally in JavaScript in your browser as you type, so there's no lag waiting on a server and no color values are ever transmitted anywhere. One thing to note: the color picker and swatch preview are HEX-based, so entering an out-of-range HSL or RGB value (like a saturation over 100%) will show a validation message rather than silently clamping it.
How to Use the Color Converter
- Enter a HEX code (like #ff6600), RGB values, or HSL values — or use the visual color picker.
- Watch the other two formats and the live swatch update instantly.
- Scroll to the WCAG contrast section to see the ratio and pass/fail rating against white and black text.
- Click Copy next to the format you need.
Features
- Three-way HEX ↔ RGB ↔ HSL conversion
- Visual color picker with live preview swatch
- Accepts shorthand HEX (#f60) and full form
- Built-in WCAG contrast checker against white and black, with AA/AAA ratings
- One-click copy in any format
Examples
Converting a brand blue
Input
#3b82f6
Output
rgb(59, 130, 246) / hsl(217, 91%, 60%)
Contrast against white
Input
#3b82f6 text on a #ffffff background
Output
3.68:1 — fails AA for normal text (needs 4.5:1)
Contrast against black
Input
#3b82f6 text on a #000000 background
Output
5.71:1 — passes AA, fails AAA (needs 7:1)
Frequently Asked Questions
What is the difference between HEX, RGB and HSL?
They describe the same color three different ways. HEX packs red, green and blue into hexadecimal pairs (#RRGGBB); RGB lists the same channels as decimal numbers from 0–255; HSL instead describes hue (0–360°), saturation and lightness (both 0–100%), which is often more intuitive for adjusting a color's tone.
What do the six HEX digits mean?
Each pair is one channel in hexadecimal: the first two digits are red, the middle two green, the last two blue. 00 means none of that channel; ff means full intensity.
What do the AA and AAA contrast ratings mean, and when do I need them?
They're WCAG accessibility thresholds for text-to-background contrast. AA (the baseline most sites target, and often a legal requirement) needs a ratio of at least 4.5:1 for normal text; AAA is stricter at 7:1. Use this checker whenever you're picking a text color over a colored background to confirm it stays readable for users with low vision.
Is the Color Converter free?
Yes, the Color Converter is completely free with no usage limits. No signup, no account and no installation required.
Does the converter work on mobile?
Yes. The converter is fully responsive and works in any modern browser on phones, tablets and desktops.
Related Tools
QR Code Generator
Create QR codes for URLs, text and Wi-Fi instantly, then download as PNG. Free client-side QR code generator — no watermark.
Gradient Generator
Create beautiful CSS gradients — linear, radial or conic — with a live preview and copy-ready CSS code. Free online gradient generator.
Color Palette Generator
Generate harmonious 5-color palettes from any base color — analogous, complementary, triadic and more. Click any swatch to copy its hex code.
CSS Minifier & Beautifier
Minify CSS to shrink file size or beautify it into readable, indented code. Free online CSS formatter — instant and client-side.
Case Converter
Convert text between UPPERCASE, lowercase, Title Case, camelCase, snake_case and more. Instant, free case conversion.
Image Color Picker
Click anywhere on an image to pick its exact color, or extract the dominant color palette automatically. Free color picker from image, no upload.
Photo Filters
Apply grayscale, sepia, brightness, contrast, saturation and blur filters to any photo with live preview presets. Free photo editor, no upload.
Binary/Hex/Decimal Converter
Convert numbers between binary, octal, decimal and hexadecimal instantly — with support for huge integers and 0x/0b prefixes.