Skip to main content
DevConverter
Home/Color/Color Converter

Color Converter

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

#3B82F6

Click the swatch to pick a color

HEX
RGB
HSL
OKLCH

Edit any field to convert instantly. OKLCH out-of-gamut values are clamped to sRGB.

About this tool

Web colors can be expressed in several formats, each suited to different contexts. Hexadecimal (#RRGGBB or #RGB) is the most common in CSS and HTML, representing each color channel as a two-digit hex value. RGB (rgb(r, g, b)) expresses channels as integers from 0 to 255, making it intuitive for mixing colors computationally. HSL (hsl(h, s%, l%)) represents hue (0–360 degrees on the color wheel), saturation (0–100%), and lightness (0–100%), which is more intuitive for designers adjusting colors.

OKLCH is a perceptually uniform color space introduced in CSS Color Level 4. 'Perceptually uniform' means that equal numerical changes produce equal perceived changes in color — a property that RGB and HSL lack. In HSL, two colors with identical saturation and lightness can look very different in perceived brightness (compare yellow and blue at the same HSL lightness). OKLCH corrects this, making it the best choice for generating consistent color scales and accessible palettes.

Color conversions between RGB and HSL are lossless within floating-point precision limits. Conversions involving OKLCH go through the CIE XYZ and OKLab intermediate color spaces. Not all OKLCH colors can be displayed on standard sRGB screens — values outside the sRGB gamut are clipped or mapped when displayed. Wide-gamut displays (P3) can show a larger range of OKLCH colors.