Color Converter: HEX, RGB and HSL

Convert a color between HEX, RGB and HSL.

FreeNo sign-upRuns in your browser

Your color

Type a HEX, RGB or HSL value, or use the picker.

Converted

#F2541B
rgb(242, 84, 27)
hsl(16, 89%, 53%)

Contrast with white text: 3.47:1 (too low for small text). With black text: 6.06:1 (passes AA).

How to use it

  1. Enter a color

    Type a HEX, RGB or HSL value, or pick one with the color picker.

  2. Read the formats

    HEX, RGB and HSL appear together with a preview swatch.

  3. Copy what you need

    Copy the format your code or design tool asks for.

This color converter turns a HEX, RGB or HSL value into the other two formats and shows a preview. It also checks the contrast against white and black text, so you can see if a color is readable. It runs in your browser.

Handy color tips

Check contrast

Low contrast text is hard to read for many people and can fail accessibility rules. Aim for 4.5 to 1 on body text.

Build shades with HSL

Keep hue and saturation, change lightness, and you get matching light and dark versions of one color.

Match your brand

Paste the code from your logo file and copy the same color into CSS, Figma or a slide.

Use one format in code

Pick HEX or HSL for your stylesheet and stay with it, so changes are easy to find.

Common questions

What is a HEX color?
A HEX color is a six-character code starting with a hash, like #F2541B. Each pair of characters is the amount of red, green and blue, from 00 (none) to FF (full).
What is the difference between RGB and HSL?
RGB mixes red, green and blue light. HSL describes a color by hue (the position on the color wheel), saturation (how vivid) and lightness (how light or dark). HSL is easier when you want a lighter or darker shade.
Does it accept short HEX codes?
Yes. A three-character code like #FA0 is the same as #FFAA00.
What does the contrast ratio mean?
It measures how easy text is to read on a background. WCAG asks for at least 4.5 to 1 for normal text and 3 to 1 for large text.
Is anything uploaded?
No. The conversion is done by your browser.

More free tools

All free tools
Text Case Converter

Switch text to upper, lower, title, sentence, camel, snake or kebab case.

Runs in your browser
QR Code Generator

Make QR codes for links, text and WiFi. Pick colors and download PNG or SVG.

Runs in your browser
Image Compressor

Compress JPEG, PNG, and WebP images directly in your browser with real-time size reduction calculations.

Runs in your browser
Password Generator

Make strong random passwords with a strength meter. Nothing is stored or sent.

Runs in your browser