Color converter

Color converter

How the color converter works

Paste a color in one of six formats, HEX, HEXA, RGB, RGBA, HSL or HSLA, and the tool shows the same color in all six. It recognises the format from what you type, so the value has to be complete: a six-digit hex code such as #1e90ff, or a full function such as rgb(30, 144, 255) or hsl(210, 100%, 56%).

HEX and RGB describe the amount of red, green and blue. HSL describes hue, saturation and lightness, which is easier to adjust by hand: change the lightness to get a darker or lighter shade of the same color. The A versions add an alpha channel for transparency.

Valid inputs

  • #ff6600 (six hex digits; three-digit shorthand like #f60 is not accepted).
  • #ff660080 (HEXA, the last two digits are opacity).
  • rgb(255, 102, 0) and rgba(255, 102, 0, 0.5).
  • hsl(24, 100%, 50%) and hsla(24, 100%, 50%, 0.5).

Common questions

Which color format should I use in CSS?

All modern browsers support every format here. HEX is compact for solid colors, and HSL is easiest when you build a palette of related shades.

Why is my color not recognised?

Check that the value is complete and uses the exact syntax shown above, including the # for hex codes and the percent signs in HSL.

How do I check whether text color is readable?

Contrast matters more than the format. Aim for a contrast ratio of at least 4.5 to 1 between normal text and its background, as the WCAG accessibility guidelines recommend.

Next steps

Case Converter · CSS Minifier · Binary Converter

Similar tools

Base64 converter
Encode and decode Base64 text.
Binary converter
Convert between binary, decimal, hex, and ASCII text.
Case converter
Convert text between UPPER, lower, Title, and Sentence case.