Color Converter

Convert any color between HEX, RGB, and HSL, see all three formats at once, and preview the color live before you copy it.

Responsive Leaderboard Ad (728x90)
Enter 6 hex digits, with or without #, for example #2563EB or FF0000. 3 digits like F00 also work.
Each channel ranges from 0 to 255.
Hue from 0 to 360 degrees; saturation and lightness from 0 to 100%.
The swatch updates when you convert from any format. Try it with your brand color.
Converted values
#2563EB
HEX
rgb(37, 99, 235)
RGB
hsl(221, 83%, 53%)
HSL
Copy-ready CSS

color: #2563EB; background-color: rgb(37, 99, 235);

Responsive Content Banner (728x90 / 300x250)

How to Use the Color Converter

Designers, developers, and printers all describe the same color in different languages. A web developer writes #2563EB, a print designer thinks in percentages of cyan and magenta, and a CSS author adjusting brightness reaches for HSL. Converting between these formats by hand is slow and error-prone, especially with the maths behind HSL. This converter does it instantly: enter a color in any one format and see all three at once, with a live swatch so you can judge the result with your eyes, not just numbers.

  1. Start from HEXType a hex code with or without the hash, for example #FF0000 or 2563EB, and press Convert from HEX. Three-digit shorthand like F00 works too and expands to FF0000.
  2. Or start from RGBEnter the red, green, and blue channels, each from 0 to 255, and press Convert from RGB. This is handy when a design tool or a screenshot picker gives you RGB values.
  3. Or start from HSLEnter hue from 0 to 360 degrees, plus saturation and lightness as percentages, and press Convert from HSL. HSL is the easiest format for creating lighter or darker versions of a color.
  4. Copy what you needThe converted values appear below, together with copy-ready CSS. The preview swatch updates from any input, so you can experiment freely and watch the color change.

HEX, RGB, and HSL Explained

HEX is the web's shorthand for RGB. Each pair of hexadecimal digits represents one channel: the first pair is red, the second green, the third blue. FF0000 is therefore pure red, 00FF00 pure green, and 000000 black, while FFFFFF is white. Hexadecimal uses digits 0 to 9 plus letters A to F, where A means 10 and F means 15, which is why two hex digits can represent every value from 0 to 255. The three-digit shorthand simply doubles each digit, so F00 becomes FF0000 and 369 becomes 336699.

RGB describes color as light: how much red, green, and blue light to mix. Screens emit light, so adding all three channels at full strength produces white, and turning them all off produces black. That additive model is intuitive for screens but awkward for humans trying to adjust a color, because changing brightness means changing all three numbers at once. HSL fixes that by describing color the way people think about it: hue is the position around the color wheel in degrees, where 0 is red, 120 is green, and 240 is blue; saturation is how vivid the color is, from grey at 0% to full colour at 100%; and lightness runs from black at 0% through the pure colour at 50% to white at 100%.

HEX #RRGGBB = RGB (red, green, blue), each 0-255
HSL (hue 0-360, saturation 0-100%, lightness 0-100%)
Examples: pure red is #FF0000 = rgb(255, 0, 0) = hsl(0, 100%, 50%). Pure green is #00FF00 = rgb(0, 255, 0) = hsl(120, 100%, 50%). Grey has 0% saturation at any hue.

Practical Uses and Accessibility Tips

The most common conversion task is moving a brand color between tools. A logo file might give you a hex code, a developer's stylesheet needs RGB for transparency effects like rgba(37, 99, 235, 0.5), and a designer creating a hover state needs HSL to lighten the same color by raising lightness ten points. Doing those steps here keeps one source of truth: type the brand color once, and every format stays consistent instead of drifting through manual retyping and rounding errors.

1. Build a palette from one color

Start from your main color in HSL, then keep the hue fixed and vary lightness: 30% for dark text, 50% for the main color, 85% for a pale background tint. The result looks designed, not random.

2. Check contrast before shipping

Light text on a light background is the most common accessibility failure on the web. Use the swatch to judge at a glance, and prefer dark text on pale colors and white text on saturated dark colors.

3. Fix colors from screenshots

Color pickers often report RGB values. Paste them here to get the hex code for your stylesheet, or the HSL values to fine-tune the shade without guessing channel by channel.

A final note on precision: converting between RGB and HSL involves rounding, because HSL percentages are whole numbers here while RGB channels are integers. Converting a color to HSL and back may shift a channel by one unit, which is invisible to the eye and normal for every converter. If you need pixel-perfect reproduction for print, keep the original hex or RGB values as your master copy. Everything here runs privately in your browser, so your brand colors and palettes are never uploaded or stored.

Frequently Asked Questions (FAQs)

What is a HEX color code?
A HEX code is a six-digit hexadecimal shorthand for RGB values, written with a leading hash, like #FF0000 for pure red. Each pair of digits stands for red, green, and blue, from 00 (none) to FF (full, or 255). Three-digit codes like F00 are shorthand that doubles each digit to FF0000.
How do I convert HEX to RGB?
Split the six hex digits into three pairs and convert each pair from hexadecimal to decimal. For #2563EB, 25 becomes 37, 63 becomes 99, and EB becomes 235, giving rgb(37, 99, 235). This converter does that arithmetic for you in either direction.
What do H, S, and L mean in HSL?
H is hue, the position on the color wheel from 0 to 360 degrees, where 0 is red, 120 is green, and 240 is blue. S is saturation, from 0% grey to 100% fully vivid. L is lightness, from 0% black through 50% pure color to 100% white.
Why does converting back and forth change a value by 1?
HSL percentages are rounded to whole numbers here, and RGB channels are integers, so a round trip can shift a channel by one unit. The difference is invisible to the eye. Keep your original HEX or RGB value as the master copy for pixel-perfect work.
Can I use this converter for print colors?
For screen design, yes. Print uses CMYK, a different model based on ink rather than light, so a screen color converted for print will look different on paper. Always proof print colors with your printer's CMYK values.
Is my color data stored?
No. All conversions run in your browser. Nothing you enter is sent to a server or stored.