Color Converter
Convert colors between HEX, RGB, HSL, and OKLCH formats instantly. Free, private, in-browser.
Color Converter
Convert colors between HEX, RGB, HSL, and OKLCH formats. Pick a color or paste any color value.
How to Use Color Converter
- 1
Enter a color
Type a color in any supported format: HEX (#ff0000), RGB (rgb(255,0,0)), HSL (hsl(0,100%,50%)), or OKLCH (oklch(0.6 0.2 30)). You can also use the color picker.
- 2
View all formats
The tool instantly converts your color to all four formats and displays a preview swatch.
- 3
Copy the format you need
Click the Copy button next to any format to copy it to your clipboard.
Frequently Asked Questions
Related Tools
Understanding Color Spaces for Web Development
HEX and RGB describe the same thing — amounts of red, green, and blue light — just in different notation. HEX uses base-16 (#FF0000), RGB uses base-10 (rgb(255, 0, 0)). HSL describes colors the way humans think: Hue (the color wheel position, 0-360), Saturation (vibrancy, 0-100%), and Lightness (brightness, 0-100%). This makes HSL far more intuitive for creating color variations — darken by reducing L, desaturate by reducing S.
Why OKLCH Is the Future of CSS Color
HSL has a fundamental flaw: its "lightness" is not perceptually uniform. An HSL yellow at 50% lightness looks dramatically brighter than an HSL blue at 50% lightness, because human vision is more sensitive to yellow-green wavelengths. OKLCH solves this — colors with the same L value in OKLCH actually look equally bright. This makes it ideal for generating accessible color palettes, creating consistent gradients, and building design systems where "light blue" and "light yellow" should have comparable visual weight.
Choosing Colors for Accessibility
WCAG 2.1 requires a minimum 4.5:1 contrast ratio for normal text and 3:1 for large text. Working in OKLCH makes this easier: you can adjust lightness to hit contrast targets while keeping the hue and chroma constant. In HSL, changing lightness often shifts the perceived hue — a problem OKLCH's perceptual uniformity avoids.