Color Code Converter β HEX, RGB, HSL, CSS
Convert HEX, RGB or HSL to matching web colour codes. Choose a colour visually, then copy HEX, RGB, rounded HSL or lowercase CSS HEX.
#3B82F6rgb(59, 130, 246)hsl(217, 91%, 60%)#3b82f6HEX: three or six digits. RGB: whole numbers from 0 to 255. HSL: hue in degrees, saturation and lightness from 0 to 100%. Hue wraps at 360Β°. RGB channels and HSL output are rounded. Invalid input keeps the last valid colour visible.
How It Works
Pick a colour or enter HEX, RGB or HSL to get matching web colour codes. Copy HEX, RGB, rounded HSL or lowercase CSS HEX for your design or stylesheet.
Use the colour picker for a visual starting point, or enter a known colour code. Three-digit HEX expands to six digits: #f00 becomes #FF0000. RGB takes red, green and blue as whole numbers from 0 to 255.
For HSL to HEX, enter hue in degrees and saturation and lightness as percentages. H 0, S 100 and L 50 produce red: #FF0000 and rgb(255, 0, 0). Hue repeats after a full 360Β° turn; saturation and lightness stay between 0 and 100.
Each output has its own copy button. HSL input becomes 8-bit RGB, and the HSL output is rounded to whole degrees and percentages. The CSS card gives a lowercase HEX value ready to use in a stylesheet. Colour conversion runs in your browser.
Features
- βVisual colour picker and preview
- βThree- and six-digit HEX input
- βRGB channels from 0 to 255
- βNumeric HSL input with decimal values
- βHEX, RGB, rounded HSL and CSS HEX output
- βA copy button for each format
How to Use This Tool
- Choose a colour or enter HEX, RGB or HSL values.
- Check the preview and correct any incomplete or invalid values.
- Read the equivalent HEX, RGB and rounded HSL codes.
- Copy the format you need for your design or stylesheet.
Perfect For
- βConvert HEX colours to RGB for a design tool
- βConvert RGB channels to HEX for CSS
- βConvert HSL values to HEX without a separate calculator
- βCopy a consistent colour code for a stylesheet