Color Code Converter
Converts color codes between HEX, RGB, and HSL formats with a live preview so you can see what the color actually looks like. Type in any format and sync to the others.
How to use
- Enter a color in whichever format you have - HEX (#ff6600), RGB (255, 102, 0), or HSL.
- Click the Sync button next to the format you entered and the others will update.
- Copy any of the converted values to use in your CSS or code.
Related tools:
Web colors live in three common formats. HEX (#FF5733) is compact and ubiquitous in CSS. RGB (255, 87, 51) is intuitive for thinking about color mixing. HSL (hue, saturation, lightness) is the most intuitive for adjusting colors - change the hue number to shift color, saturation to make it more or less vivid, lightness to make it lighter or darker.
Designers frequently need to convert between these when working with design systems, Tailwind CSS (which uses RGB and HSL), or when a client provides a brand color in one format and your codebase expects another. The live preview lets you confirm you have the right color before copying it.
Frequently Asked Questions
What is the difference between HSL and HSB/HSV?
HSL (hue, saturation, lightness): 100% lightness is white, 0% is black, 50% with 100% saturation is the pure color. HSB/HSV (hue, saturation, brightness): 100% brightness with 100% saturation is the pure color. They use different lightness/brightness models. CSS uses HSL; design tools like Photoshop often use HSB.
Can I convert RGBA or HSLA (with opacity)?
The core conversion between HEX, RGB, and HSL is for opaque colors. Opacity (alpha channel) is typically expressed separately - RGBA adds a fourth 0-1 value, HSLA adds a percentage. HEX with alpha uses an 8-digit code like #FF5733CC where the last two digits are the alpha.
Why does my HEX color look different on screen vs print?
Screens use RGB (additive color with light). Print uses CMYK (subtractive color with ink). RGB colors outside the CMYK gamut cannot be reproduced exactly in print. For print work, always work in CMYK from the start.