Skip to content
All tools

Color Converter

Available

Convert and inspect HEX, RGB, HSL and OKLCH colors locally, with gamut, luminance and contrast information.

Runs locally. Color values never leave this browser.

Color input

Enter a HEX, RGB, HSL or OKLCH value. Press Enter or use Convert.

Supported: #RGB, #RGBA, #RRGGBB, #RRGGBBAA, rgb()/rgba(), hsl()/hsla() and oklch().

Preview

on white
on black
Color is inside the sRGB gamut.
HEX
#6366F1
RGB
rgb(99 102 241)
HSL
hsl(238.7 83.5% 66.7%)
OKLCH
oklch(58.5% 0.204 277.1)

Color inspection

Source
HEX
Alpha
100%
sRGB gamut
Inside
Luminance
0.185
Contrast white
4.47:1
Contrast black
4.70:1

Conversion and inspection run entirely in the browser. No color values are stored or sent to a Devary backend.

CSS color formats in one place

Move between familiar sRGB formats and OKLCH without sending design tokens or application colors to a backend.

Explicit sRGB gamut boundary

OKLCH can describe colors outside sRGB. When that happens, Color Converter preserves the OKLCH coordinates and clearly marks HEX, RGB and HSL as sRGB-clipped representations.

Developer guide

Convert CSS colors and inspect their actual values

Compare HEX, RGB, HSL and OKLCH representations, alpha channels, sRGB gamut and contrast without guessing from color swatches.

Practical workflow

  1. Configure

    Enter a supported CSS color such as #6366f1 or an HSL function, with valid channel ranges.

  2. Try it

    Convert the value and inspect the emitted formats; compare the preview against the intended UI component.

  3. Check the result

    Review alpha, gamut and contrast figures before deciding whether a color works on its actual background.

Worked examples

Convert HEX to RGB

The parsed sRGB channels are returned in modern CSS rgb() notation.

Configuration

Convert HEX

Example input

#6366f1

Expected result

rgb(99 102 241)

Convert HSL red to HEX

A fully saturated red at zero degrees converts to the exact hexadecimal red code.

Configuration

Convert HSL

Example input

hsl(0 100% 50%)

Expected result

#FF0000

Limits and safeguards

Supported scope

Only the documented HEX, RGB, HSL and OKLCH syntaxes are supported; arbitrary CSS color functions are not.

Before using in production

Out-of-gamut OKLCH colors may be clipped for sRGB display. Contrast numbers are measurements, not a complete accessibility audit.

Common question

Is the converted HEX always perceptually identical?

Not necessarily. Alpha compositing and sRGB gamut clipping can change the final appearance; review the target background and display.