Color Converter
Convert color values between HEX, RGB, and HSL formats with a live preview swatch. Use the color picker or type any format directly. All conversion happens in your browser.
Convert colors between HEX, RGB, and HSL and copy a ready-to-use CSS custom-property value. You can type a color or use the browser color picker, then preview the converted color immediately.
How to convert a color
- Enter a 3-digit or 6-digit HEX color, an rgb(r,g,b) value, or an hsl(h,s%,l%) value.
- Choose Convert or pause briefly after typing for automatic conversion.
- Review the HEX, RGB, HSL, and CSS variable outputs plus the color swatch.
- Copy the format you want to use.
Supported color formats
HEX input accepts three or six hexadecimal digits with an optional leading #. RGB input uses integer channel values in rgb(r,g,b) form, and HSL input uses hsl(h,s%,l%) style values. HSL is converted to RGB first, then the tool derives all displayed formats from that RGB value.
The current parser is intentionally small and does not handle alpha channels, named CSS colors, modern space-separated CSS color syntax, percentages in RGB, or color spaces such as LAB, LCH, OKLCH, Display-P3, or CMYK. Use the displayed preview to catch obvious input mistakes.
Privacy and limitations
Color parsing and conversion happen locally in your browser. The tool is for straightforward HEX/RGB/HSL conversion and does not perform color-management, gamut mapping, accessibility contrast testing, or device-profile conversion.
Frequently asked questions
Does it accept 3-digit HEX colors?
Yes. A value such as #abc is expanded internally to the corresponding six-digit form.
Does it support alpha transparency?
No. The current converter handles RGB color channels without alpha.
Can I use the browser color picker?
Yes. Choosing a color from the picker fills the input and converts it automatically.
What is the CSS var result?
It is a simple custom-property declaration in the form --color: #rrggbb;.
Is color data uploaded?
No. Conversion happens entirely in the browser.