Last updated

How to Use

  1. Enter a color in any format: HEX (#667eea), RGB (rgb(102, 126, 234)), or HSL
  2. See instant color preview in the box above
  3. View conversions to all formats: HEX, RGB, and HSL
  4. Copy any format to use in your CSS, design tools, or code
  5. Try color names like "red", "blue", or "coral" for quick conversions

Common Conversion Scenarios

Color Format Guide

HEX (Hexadecimal)

Format: #RRGGBB or #RGB. Most common format in web development. Example: #667eea, #fff. Each pair represents red, green, and blue values in hexadecimal (00-FF).

RGB (Red Green Blue)

Format: rgb(R, G, B). Values range from 0-255. Example: rgb(102, 126, 234). Intuitive for understanding color composition. Supports rgba() for transparency.

HSL (Hue Saturation Lightness)

Format: hsl(H, S%, L%). Hue: 0-360 degrees, Saturation: 0-100%, Lightness: 0-100%. Example: hsl(230, 70%, 66%). Best for creating color variations and palettes.

Common Use Cases

Conversion Examples

Purple Gradient Color

HEX: #667eea

RGB: rgb(102, 126, 234)

HSL: hsl(229, 76%, 66%)

Pure Red

HEX: #ff0000

RGB: rgb(255, 0, 0)

HSL: hsl(0, 100%, 50%)

Examples

Example 1: HEX to RGB Conversion

Designers often work in HEX but CSS sometimes needs RGB for opacity control:

Input HEX:  #3b82f6

Output:
RGB:        rgb(59, 130, 246)
RGBA:       rgba(59, 130, 246, 1)
HSL:        hsl(217, 91%, 60%)
HSLA:       hsla(217, 91%, 60%, 1)
Named:      (no exact match)
HEX short:  #3b82f6 (no shorthand available)

Now you can use the RGB value to add transparency in CSS:

/* Solid button */
.btn { background-color: #3b82f6; }

/* Semi-transparent overlay using the converted RGB */
.overlay { background-color: rgba(59, 130, 246, 0.15); }

/* Hover state with slight transparency */
.btn:hover { background-color: rgba(59, 130, 246, 0.9); }

Example 2: RGB to HSL for Color Variations

HSL makes it easy to create lighter and darker shades of a color by adjusting the lightness value:

Base color RGB:  rgb(220, 38, 38)
Converted HSL:   hsl(0, 72%, 51%)

/* Create a full shade palette by adjusting lightness */
--color-red-100: hsl(0, 72%, 95%);   /* Very light */
--color-red-200: hsl(0, 72%, 85%);
--color-red-300: hsl(0, 72%, 75%);
--color-red-400: hsl(0, 72%, 65%);
--color-red-500: hsl(0, 72%, 51%);   /* Base color */
--color-red-600: hsl(0, 72%, 41%);
--color-red-700: hsl(0, 72%, 31%);
--color-red-800: hsl(0, 72%, 21%);
--color-red-900: hsl(0, 72%, 11%);   /* Very dark */

Example 3: Named Color to All Formats

CSS named colors are convenient but you sometimes need the exact values for other tools:

Input:  cornflowerblue

Output:
HEX:    #6495ed
RGB:    rgb(100, 149, 237)
RGBA:   rgba(100, 149, 237, 1)
HSL:    hsl(219, 79%, 66%)
HSLA:   hsla(219, 79%, 66%, 1)

Frequently Asked Questions

Yes, our Color Converter is completely free with no registration required. Use it unlimited times without any restrictions.

Yes, all processing happens locally in your browser. Your data never leaves your device and is not stored on our servers.

No installation needed. The tool works directly in your web browser on any device.

The tool supports all standard formats. Simply paste your input and the conversion happens instantly.

Yes, you can process multiple conversions by using the tool repeatedly. Each conversion is instant.