Color Converter

About the Color Converter

CSS colors can be expressed in several different formats — hex, rgb(), hsl(), and the newer oklch() — and design tools, style guides, and codebases don't always agree on which one to use.

This tool converts a single color between hex, RGB, HSL, and OKLCH simultaneously, with a live color picker so you can see and adjust the result visually.

How it works

Common use cases

Frequently asked questions

What is OKLCH and why would I use it?

OKLCH is a newer CSS color format built for perceptual uniformity — equal numeric changes in lightness, chroma, or hue look like equal visual changes, which makes it easier to build consistent color scales (like a 9-step gray palette) than with HSL, where perceived brightness can shift unexpectedly.

Why do RGB and HSL show slightly different rounded values than I typed?

Color conversions between spaces (especially HSL) can introduce small rounding differences due to floating-point math; the tool rounds values for display, so re-entering a rounded HSL value may shift the hex code by a tiny amount.

Does this tool support alpha transparency?

This converter focuses on solid RGB/HSL/OKLCH/hex color values without an alpha channel; for transparency, you can typically append an alpha component (like `rgba()` or an 8-digit hex) manually once you have the base color.

Why does typing an invalid hex show 'Invalid color'?

The hex field expects a valid 3- or 6-digit hex code starting with #; anything else (a typo, missing #, or wrong digit count) can't be parsed into RGB and is flagged instead of silently guessing.

This tool runs entirely in your browser — nothing you enter is sent to a server. Read more in the Privacy Policy, or browse the full list of tools.