Color Picker & Converter
Pick colors and convert between HEX, RGB, and HSL formats instantly. Free, client-side, no signup.
#6c63ffrgb(108, 99, 255)hsl(243, 100%, 69%)How to Use
- Use the color picker to select a color visually, or type a HEX value directly.
- Adjust individual R, G, B or H, S, L values for precise control.
- Click Copy next to any format (HEX, RGB, HSL) to copy the CSS-ready value.
Understanding Color Models
HEX colors are the most common format in web development. A HEX color is a six-digit hexadecimal number preceded by #. The first two digits represent red, the middle two green, and the last two blue. Each pair ranges from 00 (none) to ff (maximum). Shorthand notation (#f60) expands to the full form (#ff6600).
RGB (Red, Green, Blue) is the additive color model used by screens. Each channel accepts values from 0 to 255. Black is rgb(0, 0, 0) and white is rgb(255, 255, 255). CSS also supports rgba() with an alpha channel for transparency.
HSL (Hue, Saturation, Lightness) is designed to be more intuitive. Hue is a degree on the color wheel (0° = red, 120° = green, 240° = blue). Saturation controls color intensity (0% = gray, 100% = vivid). Lightness controls brightness (0% = black, 50% = pure color, 100% = white). HSL makes it easy to create color palettes by varying just one dimension.
CSS Color Tips
- Use
hsl()in CSS for easily readable color schemes — change the hue to shift colors while keeping consistent saturation and lightness - CSS custom properties work great with HSL:
--brand-hue: 243;thenhsl(var(--brand-hue), 100%, 69%) - Modern CSS supports
oklch()andoklab()for perceptually uniform colors, where equal numeric changes produce equal visual changes - Use the
color-mix()function in modern CSS to blend colors:color-mix(in srgb, #ff0000, #0000ff 50%)
Color Accessibility
WCAG 2.1 requires a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text (18px bold or 24px regular). When selecting colors for text and backgrounds, verify the contrast ratio meets these thresholds. Tools like the browser's DevTools accessibility panel can check contrast ratios automatically.
Related Tools
Format color palette configs with the JSON Formatter or convert to YAML. Convert hex color values between bases with the Number Base Converter. Generate QR codes with custom colors. Create random hex strings for programmatic colors. Style CSS and HTML with your chosen colors. Generate placeholder text for design mockups.
Frequently Asked Questions
- What color formats are supported?
- This tool supports HEX (e.g., #ff6600), RGB (e.g., rgb(255, 102, 0)), and HSL (e.g., hsl(24, 100%, 50%)). You can input in any format and instantly see conversions to all others.
- What is the difference between RGB and HSL?
- RGB (Red, Green, Blue) defines colors by mixing light intensities from 0-255 for each channel. HSL (Hue, Saturation, Lightness) is more intuitive: Hue is the color angle (0-360°), Saturation is intensity (0-100%), and Lightness is brightness (0-100%). HSL is often easier for designers to work with because adjusting one property creates predictable results.
- How do I get the CSS value for a color?
- Click any Copy button next to the HEX, RGB, or HSL value to copy the CSS-ready color string to your clipboard. All three formats work directly in CSS properties like color, background-color, and border-color.
- Is my data safe?
- Yes. All color conversions happen entirely in your browser using JavaScript. No data is sent to any server.
Code Examples
Learn how to use this tool programmatically in your favorite language.
Use this tool from AI agents.
The CodeTidy MCP Server lets Claude, Cursor, and other AI agents
use this tool and 46 others directly. One command: npx @codetidy/mcp