AnyTool
Your files never leave your device. All processing happens locally in your browser.

How do I convert a color between HEX, RGB, HSL, and other formats?

Enter or pick a color in AnyTool and it instantly shows every format — HEX, RGB, HSL, HSV, OKLCH, LAB, and CMYK — with two-way editing, gamut-aware math, and one-click copy. There is an eyedropper too, and everything runs in your browser.

  • All formats live: HEX, RGB(A), HSL, HSV, OKLCH, LAB, CMYK
  • Two-way editing — change any field and the rest update
  • EyeDropper to grab any on-screen color, plus alpha and named colors
  • Gamut-aware OKLCH/LAB with sRGB fallback and copy buttons
  • 100% in-browser — no upload, works offline

What is

Color Format

A color format is a way of encoding a color as numbers, such as HEX (#3366ff), RGB (51,102,255), HSL, HSV, OKLCH, LAB, or CMYK. Converting between formats lets the same color be used in CSS, design tools, and print workflows.

Developer Tools

Related terms

HEXRGBHSLOKLCHCMYKColor Gamut

Frequently Asked Questions

Paste the HEX value and the RGB, HSL, and every other format appear instantly.

Type or paste a HEX code and the converter immediately shows the RGB, HSL, HSV, OKLCH, LAB, and CMYK equivalents with copy buttons. You can also edit any of those fields directly and the HEX and all other formats update in real time.

Yes — OKLCH and LAB are supported with gamut mapping and an sRGB fallback.

The converter uses correct color science, so OKLCH and LAB values that fall outside sRGB are clamped and shown alongside their displayable sRGB fallback, instead of silently producing a wrong swatch.

Yes — it is free and all conversion runs locally in your browser.

There is no signup and no server call: every conversion is computed client-side, so it works offline after first load and your colors never leave your device.

Detailed Explanation

Methodology

How the Color Format Converter Works

AnyTool converts a single color between HEX, RGB(A), HSL, HSV, OKLCH, LAB, and CMYK with two-way binding: editing any field or slider instantly recomputes every other space and the preview swatch. Color science is handled correctly, so wide-gamut OKLCH and LAB values are gamut-mapped and shown with their sRGB fallback, and CMYK is labeled approximate (screen) since it is device-dependent. The EyeDropper API and a native color picker let users sample any color.

  • All formats live and two-way editable
  • Gamut-aware OKLCH/LAB with sRGB fallback
  • EyeDropper sampling, alpha channel, and named colors
  • CSS-ready output strings with one-click copy
  • Bundled extras: tints/shades, WCAG contrast, harmonies
Privacy & Security

Privacy and Offline Use

Every conversion is computed locally in the browser with no server call and no runtime CDN, so the tool works offline after first load and colors never leave the device.

Color Format Converter: AnyTool vs typical tools
CapabilityAnyToolTypical tools
All formats one page, liveYesOften per-pair
OKLCH + LAB + CMYKYesPartial
Gamut mapping + sRGB fallbackYesRare
EyeDropperYesRare
Works offlineYesNo

Capabilities reflect the live AnyTool tool; competitor behavior varies by service.