Skip to content
APK Peer

Color Converter (HEX, RGB, HSL)

Free · runs in your browser · nothing uploaded

Quick answer

This color converter translates any color between HEX, RGB and HSL formats, with a color picker for choosing visually. It also shows the contrast ratio against white and black text, so you can check accessibility before using a color in a design, website or app. Paste a value in any format and copy the one you need.

HEX
#15803d
RGB
rgb(21, 128, 61)
HSL
hsl(142, 72%, 29%)
Contrast on white
5.02:1 (passes AA)
Contrast on black
4.19:1 (fails AA for body text)

How to convert a color

  1. Type or paste a color in any format: #15803d, rgb(21, 128, 61) or hsl(142, 72%, 29%).
  2. Or tap Pick to choose a color visually.
  3. See the HEX, RGB and HSL values, plus contrast ratios against white and black. Copy the format you need.

Short HEX codes such as #fff are expanded automatically.

Color formats explained

FormatExampleBest for
HEX#15803DWeb design, CSS, design tools
RGBrgb(21, 128, 61)Screens, code that mixes colors
HSLhsl(142, 72%, 29%)Creating lighter and darker shades

All three describe the same color. HEX is just RGB written in hexadecimal: each pair of digits is one channel, from 00 to FF (0 to 255).

HSL is the most intuitive for adjusting colors. Keep the hue the same and change the lightness to get a darker shade for hover states or a lighter tint for backgrounds.

Checking contrast

Text needs enough contrast against its background to be readable, especially for people with low vision and on phones in bright light. The Web Content Accessibility Guidelines (WCAG) recommend:

TextMinimum contrast (AA)
Normal text4.5:1
Large text (about 24px, or 19px bold)3:1

The converter shows the contrast of your color against white and black, and whether each passes for normal text. If neither passes, choose a darker or lighter shade by adjusting the lightness in HSL.

To find the exact color of something in a photo or screenshot, use the image color picker. For hexadecimal numbers in general, the number base converter helps.

Everything runs in your browser.

Frequently asked questions

How do I convert HEX to RGB?

A HEX color has three pairs of hexadecimal digits for red, green and blue. Each pair converts to a number from 0 to 255, so #15803D is rgb(21, 128, 61). Paste either format here to get the other.

What is HSL?

HSL describes a color by hue (the position on the color wheel, 0–360°), saturation (how vivid it is) and lightness (how light or dark). It's easier than HEX for making lighter or darker shades of the same color.

What contrast ratio do I need?

WCAG accessibility guidelines ask for at least 4.5:1 between normal text and its background, and 3:1 for large text. The tool shows whether your color passes against white and black.

Last updated by the APKPeer Editorial Team. Read our privacy policy for how the site handles data.