Color Converter

Convert colors between HEX, RGB, HSL, and OKLCH.

🔒 Client · Offline

#7c3aed

sRGB: inside Display P3: inside
Sets the decimal places of the HSL and the OKLCH values.

HEX

#7c3aed

RGB

rgb(124, 58, 237)

HSL

hsl(262.12, 83.26%, 57.84%)

OKLCH

oklch(54.13% 0.25 293.01)

sRGB

R
124
G
58
B
237

HSL

H
262.12°
S
83.26%
L
57.84%

OKLCH

L
54.13%
C
0.25
H
293.01°

About color conversion

This tool converts between HEX, RGB, HSL, and OKLCH color values. It also shows a large swatch, the channel values of each space, and a copy action for each format. Type a color or drag the color picker. Each output changes immediately.

Each output format keeps the alpha value. An 8-digit hex holds it, and the rgb(), hsl(), and oklch() forms hold it after a slash. No output format of this tool discards alpha. The color picker sets only the R, G, and B channels, and it keeps the current alpha value.

The Decimals control sets the decimal places of the HSL and the OKLCH values. HEX uses hexadecimal bytes and RGB uses integer channels, so the control does not change them.

OKLCH is a perceptual color space. Two colors with the same L value look equally bright. CSS accepts the oklch() form, so you can paste the result into a stylesheet.

OKLCH holds colors that a screen cannot show. The gamut badges tell you if the color fits in sRGB, which every screen shows, and in Display P3, which a wide-gamut screen shows. The HEX and the RGB values are always the nearest sRGB match.