Color Converter

HEX, RGB, HSL, CMYK and OKLCH in one place.

  • Runs in your browser
  • Free
  • No sign up

HEX, RGB, HSL, HSV, CMYK, OKLCH, RGB 0-1 or a CSS name like tomato: every format is converted at once.

#2F6FEBThe quick brown fox
White text: 4.57:1AA
Black text: 4.59:1AA
Lighter and darker

Every format

  • rgb(47, 111, 235)
  • #2F6FEB
  • hsl(220, 82%, 55%)
  • hsv(220, 80%, 92%)
  • cmyk(80%, 53%, 0%, 8%)
  • oklch(57.3% 0.199 261.8)
  • 0.184, 0.435, 0.922

You may also like

See all tools

Every color format at once

Paste a color in any format and get it in all the others: HEX, RGB, HSL, HSV, CMYK, OKLCH and RGB from 0 to 1. No need to choose "from" and "to": the tool reads what you paste, even a CSS name, and every value has its copy button. You also see the color with white and black text and their contrast ratio, and ten lighter and darker shades of the same hue to use as hover colors or backgrounds.

How to convert a color

  1. Paste or type a color code, or pick one with the color square.
  2. Read the result in every format. Click a format name to put it first.
  3. Click the copy button next to the value you need.

What to use it for

  • Web design and CSS: HEX from a design file to rgb() or the modern oklch().
  • Print: a first CMYK value for a brand color, before checking with the printer.
  • Apps and games: RGB from 0 to 1 for Swift, Unity or shaders.
  • Accessibility: check that text stays readable on a brand color.
  • Design systems: lighter and darker shades of one color, in one click.

Frequently asked questions

How do I convert HEX to RGB?

Paste the HEX code (with or without #) in the box: the RGB value appears right away, with HSL, HSV, CMYK and OKLCH. A HEX code is three pairs of hexadecimal digits for red, green and blue: #2F6FEB is 2F = 47 red, 6F = 111 green and EB = 235 blue, so rgb(47, 111, 235).

Which formats can I paste?

HEX (#2F6FEB, 2f6feb, #26E, and #2F6FEB80 with transparency, which is left out), rgb() and rgba(), hsl() and hsla(), hsv() or hsb(), cmyk() in percent or from 0 to 1, oklch(), three numbers like 47 111 235, three numbers from 0 to 1 like 0.18, 0.44, 0.92, and CSS color names like tomato or rebeccapurple.

Why is the CMYK value only an estimate?

Screens mix light (RGB) and printers mix ink (CMYK). The conversion here is the standard formula, without the color profile of a printer or a paper. It is a good starting point, but for exact print colors ask your printer for their profile or use a Pantone reference.

What is OKLCH and why use it?

OKLCH describes a color by its lightness, chroma (how colorful it is) and hue, in a way that matches how eyes see differences. Two colors with the same lightness look equally light, which HSL does not guarantee. Modern browsers accept it in CSS, for example color: oklch(57% 0.2 262).

What does the contrast ratio mean?

It tells how readable white or black text is on the color, from 1:1 (invisible) to 21:1 (black on white). The WCAG accessibility guidelines ask for 4.5:1 for normal text (AA), 3:1 for large text, and 7:1 for the stricter AAA level.

Is the conversion exact?

HEX, RGB and RGB 0-1 are exact. HSL, HSV and CMYK are rounded to whole numbers like most design tools show them, so converting back can move a channel by one or two units out of 255, which the eye cannot see.

Related tools