Color Picker & Converter

Pick a color visually or enter a hex code to get its RGB and HSL values.

HEX:

RGB:

HSL:

CSS:

How to use the color converter

Click the color picker square to open your browser color chooser and select any color visually. Alternatively, type a hex code directly into the hex input field and click Convert. The tool instantly shows the equivalent values in HEX, RGB, and HSL formats, displays a color preview swatch, and suggests whether black or white text provides better contrast on that background.

Understanding color formats

HEX (hexadecimal) is the most widely used format in web design and graphic design software. A hex code like #2563EB represents the red, green, and blue components as pairs of hexadecimal digits ranging from 00 to FF. It is compact and easy to copy into CSS or design tools.

RGB (Red Green Blue) expresses each color channel as a number from 0 to 255. The format rgb(37, 99, 235) is used directly in CSS and is helpful when you need to apply transparency using rgba(), such as rgba(37, 99, 235, 0.5) for a 50% transparent version of the color.

HSL (Hue Saturation Lightness) is the most intuitive format for humans to reason about color. Hue is a degree on the color wheel from 0 to 360. Saturation is the intensity of the color from 0% (gray) to 100% (vivid). Lightness runs from 0% (black) to 100% (white). HSL makes it easy to create color variations by adjusting only the lightness or saturation values.

Color contrast and accessibility

Web accessibility guidelines (WCAG) require a minimum contrast ratio of 4.5:1 between text and its background for normal text. The converter calculates the relative luminance of your chosen color and recommends whether black or white text provides better readability. Dark colors generally pair better with white text and light colors with black text.

Frequently asked questions

What is the difference between #RGB and #RRGGBB hex codes?
The shorthand #RGB format uses three digits where each digit is doubled. So #2EB is the same as #22EEBB. The full #RRGGBB format gives more precise control over each channel with 256 possible values rather than 16.
Can I enter a color name like "red" or "blue"?
The converter accepts only hex codes in the text input. For named colors, use your browser developer tools to find the hex equivalent, or type the hex value directly.
Why does the contrast suggestion matter?
Text that does not have enough contrast against its background is difficult to read for people with low vision or color blindness. Choosing colors that meet WCAG contrast standards makes your design accessible to a wider audience.