</>

WebDevTools

Color Converter

Convert colors between HEX, RGB and HSL

Convert between HEX, RGB and HSL in real time. Generate CSS code for color, background and border. Essential for design systems and palette fine-tuning.

Color Picker

#3B82F6
R59
G130
B246
H217°
S91%
L60%

Color Values

CSS Code

Guide: convert colors between HEX, RGB, and HSL

Designers ship HEX from Figma while modern CSS favors `hsl()` for theming and `rgb()` with alpha. Mental math between formats causes rounding mistakes and lost transparency.

The visual picker and numeric fields keep HEX, RGB/RGBA, and HSL/HSLA in sync locally — no palette data leaves your browser, which helps under NDA brand work.

Use when migrating CSS variables, documenting design tokens, or checking WCAG contrast. HSL makes it easy to tweak lightness for hover states without shifting hue.

Step by step

  1. Enter or pick a colorType `#336699`, `rgb(51, 102, 153)`, or use the picker. Invalid values are rejected immediately.
  2. Switch output formatCopy the format your stack needs: HEX for some assets, HSL in `@theme`, RGBA for overlays.
  3. Tune alpha when neededSet opacity for modals, glass effects, or subtle borders — alpha shows in RGBA and HSLA.
  4. Apply in codePaste into custom properties (`--color-primary`), Tailwind config, or CSS-in-JS without manual recalculation.

Frequently asked questions