ToolNest logoToolNest.

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
🔒 100% Private: Data never leaves your device.

✓ Free forever  ·  ✓ No signup  ·  ✓ Tool inputs stay in your browser — never sent to our servers.

Try next: Meta Tag Generator · Markdown to HTML · UUID Generator

How to Use the Color Converter

  1. Type a HEX code (e.g., #3b82f6) or adjust the R, G, B values.
  2. All formats update live, with a preview swatch of the color.
  3. Read off RGB, HEX, and HSL values for your code or design tool.
  4. Check the contrast ratio to see if text in this color passes WCAG AA on white.

Why Use Our Color Converter?

Common Use Cases

Color Converter vs Alternatives

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.