Free Online Color Converter
Last updated: November 13, 2026
Quick answer: Translate colors between formats in real time. Our free color converter turns HEX into RGB, RGB into HEX and HSL, shows a live preview, and checks the WCAG contrast ratio — everything a developer or designer needs when moving colors between code and design tools.
rgb(59, 130, 246)RGB
—HSL
—Contrast vs white
✓ Free forever · ✓ No signup · ✓ Tool inputs stay in your browser — never sent to our servers.
How to Use the Color Converter
- Type a HEX code (e.g., #3b82f6) or adjust the R, G, B values.
- All formats update live, with a preview swatch of the color.
- Read off RGB, HEX, and HSL values for your code or design tool.
- Check the contrast ratio to see if text in this color passes WCAG AA on white.
Why Use Our Color Converter?
- HEX ↔ RGB ↔ HSL — convert in any direction, live as you type.
- Live preview — see the color instantly, no guessing.
- Contrast checker — WCAG ratio against white and black for accessible text.
- Copy-ready values — formatted for CSS (rgb(), hsl(), #hex).
Common Use Cases
- Matching a brand color from a screenshot: A client sends a logo image with no brand guide: sample the dominant color's HEX, convert it to RGB for the stylesheet, and read off the HSL so the hover state can be a few lightness points darker.
- Building an accessible palette: Before a palette ships, every text/background pair gets its contrast ratio checked here — body copy needs 4.5:1, large headings 3:1 — so accessibility is verified at design time, not after a failed audit.
- Translating design-tool values into code: Figma and Sketch hand you HEX; CSS often wants rgb() or hsl() for opacity and lightness tweaks. Paste the HEX once and copy whichever format the codebase uses, with the live preview confirming it is the same color.
Color Converter vs Alternatives
- Browser DevTools color picker: Chrome and Firefox DevTools include a color picker that converts formats on the fly and even shows a contrast hint — handy when you are already inspecting an element. But it only works inside DevTools on the page you are debugging, and copying values out of it is fiddly; this page is a standalone converter with copy-ready values for any color, no page open required.
- Design tools like Figma and Sketch: Figma and Sketch show HEX, RGB, and HSL for every swatch in a design file, which is the richest option when the color lives in a design. They require opening the design file or app, though, and they do not check contrast ratios in one place — this page converts any color in seconds with no account and no file to open.
Pick the format your code needs — HEX for compact CSS, RGB when you tweak channels, HSL when you tune lightness — and check the contrast before the color ships.
Frequently Asked Questions
How do I convert HEX to RGB manually?
Split the hex into three pairs (#3b82f6 → 3b, 82, f6) and convert each from base-16 to decimal: 59, 130, 246 → rgb(59, 130, 246).
What is HSL?
Hue, Saturation, Lightness — a more intuitive way to tweak colors than RGB. Hue is the color angle (0–360°), the rest are percentages.
What contrast ratio do I need for text?
WCAG AA requires 4.5:1 for normal text and 3:1 for large text. This tool shows you the ratio live.
Does it support 3-digit HEX like #fff?
Yes — shorthand hex codes are expanded automatically.
Is it free?
Yes — free forever, no signup, runs in your browser.
How do I convert RGB to HEX manually?
Convert each channel (0-255) to two hexadecimal digits: 59 becomes 3b, 130 becomes 82, and 246 becomes f6, so rgb(59, 130, 246) is #3b82f6. Values under 16 get a leading zero — 5 becomes 05, not 5 — because each channel always needs exactly two digits. The letters a-f stand for 10-15, so ff is 255 and 00 is 0.
What is the difference between HEX and RGB?
They describe the exact same color in different notation: HEX is RGB written in base-16 with a # in front (#3b82f6 is rgb(59, 130, 246)). HEX is shorter in code and is the default in most design tools; RGB spells out the three channels, which is easier when you are tweaking one channel at a time. CSS accepts both, so use whichever your workflow reads faster — the rendered color is identical.
How do I convert HEX to HSL?
Convert HEX to RGB first, then normalize each channel to 0-1 and take the largest and smallest values: lightness is the average of the two, saturation comes from their difference, and hue depends on which channel is largest. For example, #3b82f6 (rgb 59, 130, 246) becomes hsl(217, 91%, 60%) — a saturated blue at 60% lightness. Doing it by hand is error-prone, which is why this tool shows the HSL value live as you type.
What contrast ratio does #3b82f6 have on white?
About 3.7:1 — it passes WCAG AA for large text (which needs 3:1) but falls short of the 4.5:1 required for normal body text on white. The rule: normal text needs 4.5:1 for AA and 7:1 for AAA; large text (18pt or 14pt bold and up) needs 3:1 for AA and 4.5:1 for AAA. If your blue fails at body size, darken it toward #1d4ed8 or put it on a dark background instead of guessing.
Why does my HEX color look different in print than on screen?
Screens mix light (RGB, additive) while printers mix ink (CMYK, subtractive), and their color gamuts do not fully overlap — bright blues and greens shift the most. A #3b82f6 that glows on screen can print duller and darker. For anything that goes to print, preview the color in CMYK or pick from a print-safe palette rather than trusting the screen swatch.
What does the # mean in a HEX code?
The # marks the value as a hexadecimal color literal in CSS — without it, a browser would not know 3b82f6 is a color. The six digits are three two-digit hex values: the first pair is red, the second green, the third blue. Three-digit shorthand like #fff is the same idea with each digit doubled (#ffffff), which is why it only works when each channel's two digits match.