Color Converter
v1.0.0Convert colors between HEX, RGB, HSL, and HSB formats with a live preview swatch. Paste any color value and instantly see all representations.
Color Input
Use the color picker or type any HEX, RGB, HSL, or HSB value above.
Converted Colors
Enter a color value to see conversions
Translate between HEX, RGB, HSL, and HSB in one place. Pick the model that matches your job—token ramps in HSL, precise channels in RGB, handoffs in HEX.
Read the full guide →Frequently Asked Questions
- When should I use HEX vs RGB vs HSL?
- HEX is compact and universal in design handoffs. RGB maps directly to sRGB channels and is explicit in `rgb()`. HSL separates hue, saturation, and lightness—intuitive for building palettes and hover states by nudging lightness without touching hue. Pick one source of truth in your design tokens and convert for output targets.
- Why do designers prefer HSL for themes?
- Adjusting `l` (lightness) or `s` (saturation) while holding `h` (hue) yields consistent tints and shades. That matches mental models better than tweaking three RGB sliders. Modern CSS also offers `oklch()` and `lch()` for perceptual uniformity—HSL remains widely understood tooling.
- How do alpha channels work across formats?
- `#RRGGBBAA` and `#RGBA` shorthand exist in modern CSS; `rgb()` and `hsl()` accept a fourth parameter for alpha. When converting, preserve alpha explicitly—dropping it changes compositing against non-white backgrounds. SVG and canvas fills use the same CSS color grammar in many stacks.
- What CSS color functions should I standardize on?
- `rgb()`, `hsl()`, `hwb()`, and emerging `color()` with color spaces cover most UI work. PostCSS and browsers differ in support—verify your baseline. For variables, store canonical values once and derive steps with `color-mix()` where supported.
- How does color relate to WCAG contrast?
- Contrast ratios compare relative luminance of text and background in sRGB. Tools need correct hex/RGB inputs; perceived lightness in HSL does not equal WCAG luminance. Always validate with a contrast checker after conversion—especially for brand colors near the 4.5:1 or 3:1 thresholds.