Color Converter
Convert colors between HEX, RGB and HSL with a live preview.
Color Converter — Enter a color in any notation — HEX, RGB or HSL — and the other formats update instantly with a large live swatch. A native color picker is included, and each value has a one-click copy button. Perfect for matching brand colors between CSS and design tools.
What is Color Converter?
Color Converter is a free online HEX to RGB to HSL color converter for developers and designers. Type a color in any notation — HEX (#rrggbb or the #rgb shorthand), RGB (like "255, 100, 0" or "rgb(255 100 0)"), or HSL (like "220, 91%, 64%") — and every other format updates instantly next to a large live preview swatch. A native color picker lets you choose a shade visually, and each value has a one-click copy button, so it is handy whenever you need to match brand colors or translate CSS color values between code and design tools.
How to use Color Converter
- Type or paste a color into the HEX, RGB, or HSL field, or click the color picker swatch to choose a shade visually.
- Watch the other two fields and the large preview swatch update instantly to reflect the same color.
- Read the R / G / B, H / S / L, and HEX summary tiles below for the converted channel values.
- Click the copy button next to a field to copy its value: HEX copies the #rrggbb string, while RGB and HSL copy ready-to-use rgb(...) and hsl(...) strings.
- If a value is rejected, check the inline error and re-enter it in the format shown by the field hint.
Examples
HEX to RGB and HSL
Input
#ff6400
Output
RGB 255, 100, 0 / HSL 24, 100%, 50%
Shorthand #rgb expansion
Input
#fff
Output
HEX #ffffff / RGB 255, 255, 255 / HSL 0, 0%, 100%
Pick a color visually
Click the swatch to open the native color picker, drag to choose any shade, and the HEX, RGB, and HSL fields fill in automatically with the matching values.
Frequently asked questions
- Which color formats does this converter support?
- It converts between three formats: HEX (full #rrggbb and the #rgb shorthand), RGB (0-255 per channel), and HSL (hue in degrees, saturation and lightness as percentages). It does not currently handle alpha/opacity, HSV, CMYK, or named CSS colors.
- Why does my color show an "Invalid HEX color", "Invalid RGB color", or "Invalid HSL color" error?
- The value does not match the expected format or is out of range. HEX must be 3 or 6 hex digits, RGB channels must be 0-255, and HSL saturation and lightness must be 0-100%. Re-enter it following the hint under that field.
- Can I paste a full CSS value like rgb(255 100 0)?
- Yes. The RGB and HSL fields just pull the numbers out of the text, so "255, 100, 0" and "rgb(255 100 0)" both work, and the copy buttons output ready-to-use rgb(...) and hsl(...) strings.
- Are the converted values rounded?
- Yes. RGB channels and HSL values are rounded to whole numbers, so a round-trip conversion may differ by one unit from the original. The HEX output is always two digits per channel (#rrggbb).
- Does my color data get uploaded anywhere?
- No. The entire conversion runs locally in your browser with JavaScript — nothing is sent to a server and no color values are uploaded, so it works privately and even offline once the page is loaded.
Related tools
Base32 / Base58 Encode / Decode
Encode text to Base32 (RFC 4648) or Base58 (the Bitcoin alphabet) and decode either one back to text, fully UTF-8 safe and entirely in your browser.
Base64 Encode / Decode
Encode text to Base64 or decode Base64 back to text (UTF-8 safe).
Case Converter & Counter
Change text case and count characters, words and lines.
Code Formatter & Minifier
Beautify or minify HTML, CSS and JavaScript instantly in your browser, with 2-space, 4-space or tab indentation and Terser-powered JavaScript compression.