Color Code Converter
Convert HEX/RGB/HSL (RGBA/HSLA/HEX8) + contrast ratios
How to Use
- Enter a color code
Enter in HEX (#RRGGBB), RGB (rgb(r,g,b)), or HSL (hsl(h,s%,l%)) format.
- Click Convert
Press "Convert" to see the color in all formats with a live preview.
- Copy result
Use the "Copy" button to copy the results to your clipboard.
Color Code Converter Examples
HEX → RGB/HSL
#2563ebHEX: #2563eb
HEX8: #2563ebff
RGB: rgb(37, 99, 235)
RGBA: rgba(37, 99, 235, 1)
HSL: hsl(221, 83%, 53%)
HSLA: hsla(221, 83%, 53%, 1)The tool also shows a live preview and contrast ratios (white/black).
RGB → HEX/HSL
rgb(255, 0, 0)HEX: #ff0000
HEX8: #ff0000ff
RGB: rgb(255, 0, 0)
RGBA: rgba(255, 0, 0, 1)
HSL: hsl(0, 100%, 50%)
HSLA: hsla(0, 100%, 50%, 1)Features
- HEX/RGB/HSL + alpha variants (RGBA/HSLA/HEX8)
- Color picker + alpha slider
- Preview + contrast ratios (white/black)
- Supports shorthand HEX (#RGB)
- Local processing (your input is not sent to servers)
- Dark mode support
FAQ
What is a HEX color code?
A HEX color code represents a color using a # followed by six hexadecimal digits in #RRGGBB format. Values range from 00 to FF for each channel (red, green, blue). It is the most common format in CSS and web design.
What is the difference between RGB and HSL?
RGB specifies colors using red (R), green (G), and blue (B) values from 0 to 255. HSL uses hue (H: 0-360°), saturation (S: 0-100%), and lightness (L: 0-100%), which is closer to how humans perceive colors.
Is my data sent to a server?
No. All conversion happens locally in your browser via JavaScript. No data is ever transmitted externally.