Last updated
How to Use
- Enter a color in any format: HEX (#667eea), RGB (rgb(102, 126, 234)), or HSL
- See instant color preview in the box above
- View conversions to all formats: HEX, RGB, and HSL
- Copy any format to use in your CSS, design tools, or code
- Try color names like "red", "blue", or "coral" for quick conversions
Common Conversion Scenarios
- Figma/Sketch exports RGB → convert to HEX for CSS
- HEX from a style guide → convert to RGBA for transparency effects
- RGB base color → convert to HSL to generate a shade palette
- Named color in CSS → convert to HEX for use in design tools
- HSL from a color picker → convert to HEX for cross-platform compatibility
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
- CSS Development: Convert design tool colors to CSS-compatible formats
- Design Systems: Maintain consistent color formats across projects
- Color Palettes: Create variations using HSL adjustments
- Accessibility: Check color values for contrast ratio calculations
- Documentation: Provide multiple formats for developer reference
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%)