Free tool
Runs in your browserColor Converter
Convert a color between HEX, RGB, HSL, and OKLCH. Every value reads back as exactly the same color.
What it does
Paste one color in any CSS format and get it as HEX, RGB, HSL, and OKLCH. The converter first says which format it read, then shows the final color your screen displays.
How to use it
- Paste a color: hex with 3, 4, 6, or 8 digits, rgb(), hsl(), hwb(), oklch(), lab(), or a name such as rebeccapurple.
- Read the four values. Each one has its own copy button.
- Paste the value you need into your CSS, design file, or code.
Why the values match exactly
Rounded values drift: convert a color to HSL and back, and you can end up one shade off. Here each value uses the shortest precision that still reads back as the same 8-bit color, and that is tested, not assumed. A color outside what an sRGB screen can show, such as a wide-gamut oklch(), is first mapped to the closest color the screen can show, so all four values describe the same visible color. Colors with transparency are not accepted.
Related: color pages for 672 named colors · Color Scale Generator
Private by design
Your code never leaves your browser. Colors you type here stay on your device.
Results use the same color engine as the builder, judged on the final 8-bit colors, with WCAG 2.2 deciding pass or fail.