Color Converter

Convert color codes instantly between HEX, RGB, and HSL notation, including 3-digit shorthand HEX. Useful for matching a brand color across design and development tools, with every conversion processed locally in your browser.

RGBrgb(59, 130, 246)
HSLhsl(217, 91%, 60%)

Usage examples

Converting a color code from a design mockup

Take a HEX code from your design tool and convert it to the RGB or HSL value you need to drop straight into CSS.

Building a HEX code from RGB values

Enter the RGB numbers you picked up from an image editor to instantly get the matching HEX code for your code.

Using HSL to reason about brightness and saturation

Convert the same color to HSL to see how to adjust saturation or lightness while keeping the hue exactly the same.

Matching a brand color across design and development tools

Convert a brand's official HEX color, like #1DA1F2, to RGB and HSL so every tool and stylesheet in the project uses the exact same shade.

Checking a color picked from an image

Use the color preview and picker to fine-tune a swatch sampled from a photo, then read off its HEX, RGB, and HSL values together.

Quick reference

HEXRGBHSL
#000000rgb(0, 0, 0)hsl(0, 0%, 0%)
#FFFFFFrgb(255, 255, 255)hsl(0, 0%, 100%)
#FF0000rgb(255, 0, 0)hsl(0, 100%, 50%)
#00FF00rgb(0, 255, 0)hsl(120, 100%, 50%)
#0000FFrgb(0, 0, 255)hsl(240, 100%, 50%)
#FFFF00rgb(255, 255, 0)hsl(60, 100%, 50%)
#00FFFFrgb(0, 255, 255)hsl(180, 100%, 50%)
#FF00FFrgb(255, 0, 255)hsl(300, 100%, 50%)
#808080rgb(128, 128, 128)hsl(0, 0%, 50%)
#C0C0C0rgb(192, 192, 192)hsl(0, 0%, 75%)
#800000rgb(128, 0, 0)hsl(0, 100%, 25%)
#008000rgb(0, 128, 0)hsl(120, 100%, 25%)
#000080rgb(0, 0, 128)hsl(240, 100%, 25%)
#808000rgb(128, 128, 0)hsl(60, 100%, 25%)
#008080rgb(0, 128, 128)hsl(180, 100%, 25%)
#800080rgb(128, 0, 128)hsl(300, 100%, 25%)
#FFA500rgb(255, 165, 0)hsl(39, 100%, 50%)
#3B82F6rgb(59, 130, 246)hsl(217, 91%, 60%)

Frequently asked questions

Is the color value I enter sent to a server?

No. All conversions happen entirely in your browser, and the color values you enter are never sent to a server.

Does it support 3-digit shorthand HEX codes?

Yes. Shorthand codes like #FFF are recognized and expanded to 6 digits before converting.

What format should I use for RGB or HSL input?

Separate the numbers with commas or spaces — for example "59, 130, 246" for RGB or "217, 91, 60" for HSL.

Does picking a color with the color picker update the values too?

Yes. Any color chosen with the picker instantly updates the HEX, RGB, and HSL values.

What's the actual difference between RGB and HSL for the same color?

RGB describes a color as mixed amounts of red, green, and blue light, while HSL describes the same color by hue, saturation, and lightness. They represent the identical color — HSL just tends to be more intuitive for adjusting "how vivid" or "how light/dark" a color is without changing its hue.

Can I convert colors that include transparency, like RGBA or HEX with alpha?

No. This tool only handles opaque HEX, RGB, and HSL values. Alpha/transparency channels (RGBA, HSLA, or 8-digit HEX) aren't supported, so drop the alpha component before converting.

Why do HEX codes use letters as well as numbers?

HEX values are written in base 16 (hexadecimal), where each pair of digits represents a number from 0-255 using the digits 0-9 and letters A-F. That's why a HEX code like #3B82F6 mixes numbers and letters.