DataHub Tools Color Converter

HEX RGB HSL Color Converter

Local-first

Convert HEX, RGB, and HSL colors with a compact local color report.

How this tool actually works

The converter accepts 3/4/6/8-digit HEX, legacy or modern RGB syntax, percentages, and HSL/HSLA with optional alpha. It validates channels and emits normalized HEX, RGB, HSL, and alpha values.

  • Read HEX, RGB, and HSL input
  • Support modern space/slash syntax and alpha
  • Validate channel and percentage ranges

How to use it

  1. Enter a supported HEX, RGB(A), or HSL(A) value.
  2. Convert and check normalized channels and alpha.
  3. Use the output as an sRGB representation.
  4. Verify browser rendering when color-space or gamut behavior matters.

Quick example

Example input

#0f766e

Expected result

HEX: #0f766e
RGB: rgb(15, 118, 110)
HSL: hsl(175, 77%, 26%)

The tool handles sRGB-style HEX/RGB/HSL syntax; it does not convert wide-gamut color(), lab(), lch(), oklab(), or oklch() color spaces.

Best use cases

  • Convert an opaque legacy color value.
  • Compare basic HEX and RGB notation.
  • Get a rounded HSL approximation for design review.

References and scope

CSS Color 4 defines additional color spaces beyond the sRGB HEX/RGB/HSL subset implemented here.

Sources checked July 24, 2026. Specifications and platform behavior can change; verify the sources before formal use.

Known limitations

  • RGB channels, percentages, and alpha are range-validated.
  • Alpha is emitted separately and encoded in HEX when below 1.
  • Rounded HSL output may not round-trip byte-for-byte.

FAQ

Can I paste HSL input?

Yes. HSL and HSLA with percentage saturation and lightness are supported.

Is alpha preserved?

Yes. RGBA, HSLA, and 4/8-digit HEX alpha are reported and encoded in output HEX.

Does it support modern rgb(15 118 110 / 50%) syntax?

Yes, including percentage channels.

Are channel ranges validated?

Yes. Invalid RGB, percentage, HSL, or alpha ranges produce an error.