Color Converter (HEX, RGB, HSL)

Convert colors between HEX, RGB, HSL and CMYK, pick colors visually and check WCAG contrast against white and black text.

Updated October 7, 2026 By

Runs in your browser Free · No sign-up

Loading tool…

How to use the Color Converter (HEX, RGB, HSL)

  1. Enter a color such as #1d4ed8 or rgb(29, 78, 216), or use the color picker.
  2. Copy the HEX, RGB, HSL or CMYK value you need.
  3. Check the contrast ratios to choose readable text colors.

About this tool

Designers and developers often need the same color in several formats. Enter any HEX, RGB or HSL value, or use the picker, and copy whichever format you need. The contrast check shows whether text on that color is readable.

  • Private: your data is processed on your device and never uploaded.
  • Free with no account, limits or watermarks.
  • Fast: results appear instantly, even offline once the page has loaded.

What the Color Converter (HEX, RGB, HSL) does

The color converter translates any color between HEX, RGB, HSL and CMYK. Type a value in any of the common formats — #1d4ed8, rgb(29, 78, 216) or hsl(224, 76%, 48%) — or choose a color with the picker, and all other formats appear instantly, ready to copy.

It also checks accessibility. For every color the tool calculates the contrast ratio against white and against black text and rates it according to the Web Content Accessibility Guidelines (WCAG): AAA, AA, AA for large text only, or fail. That tells you at a glance whether text on a button, banner or background will be readable for everyone.

Everything runs in your browser, so it is fast and works offline once the page has loaded.

When to use it

  • Web design and CSS

    Convert colors from a design file into the format your stylesheet uses, or adjust lightness in HSL.

  • Brand guidelines

    Document a brand color in HEX, RGB and CMYK so it can be used consistently on screen and in print.

  • Accessibility checks

    Make sure text and buttons meet the WCAG contrast requirements before a website goes live.

  • Presentations and office documents

    PowerPoint, Word and Canva often ask for RGB or HEX values — convert them in seconds.

Tips for the best results

  • Use HSL to create lighter or darker variants of a color: keep hue and saturation, change only the lightness.
  • For body text, aim for a contrast ratio of at least 4.5:1 (AA); large headings need at least 3:1.
  • CMYK values here are a mathematical conversion. For professional printing, ask your printer for values based on their color profile.
  • Screens display colors differently; check important colors on several devices.
  • Three-digit HEX codes like #fa0 are a shorthand for #ffaa00 and are recognized too.

How the Color Converter (HEX, RGB, HSL) works

HEX is simply RGB written in hexadecimal: each pair of digits is one channel from 00 to FF (0 to 255). HSL describes the same color as hue (0–360°), saturation and lightness, which is more intuitive for creating variations. CMYK is derived from RGB using the standard formula K = 1 − max(R, G, B) and C, M, Y relative to the remaining brightness.

Contrast is calculated with the WCAG formula: the relative luminance of both colors is computed from their gamma-corrected RGB values, and the ratio (L1 + 0.05) ÷ (L2 + 0.05) ranges from 1:1 (no contrast) to 21:1 (black on white).

A ratio of 7:1 or more passes AAA, 4.5:1 passes AA for normal text and 3:1 passes AA for large text (about 24 px, or 19 px bold).

Frequently asked questions

How do I convert HEX to RGB?

Split the six digits into three pairs and convert each from hexadecimal to decimal: #1d4ed8 → 1d = 29, 4e = 78, d8 = 216, so rgb(29, 78, 216).

Is the CMYK value exact for printing?

No. It is a simple mathematical conversion. Professional printing uses color profiles, so ask your printer for exact values.

What is the difference between RGB and CMYK?

RGB mixes light for screens (red, green, blue). CMYK mixes ink for print (cyan, magenta, yellow, black). Some bright screen colors cannot be printed exactly.

What does the WCAG contrast rating mean?

It shows whether text in that color combination is readable for people with low vision. AA is the usual legal and industry minimum; AAA is stricter.

Guides for this tool