Color Code Converter (HEX ⇄ RGB ⇄ HSL ⇄ CMYK)

Convert color codes between HEX, RGB, HSL and CMYK in real time. Pick a color, view previews, copy values, and check contrast against white and black. Perfect for designers, front-end developers and printers.

Start from any hue and watch every code update.

Edit HEX, RGB, HSL or CMYK directly. The internal engine keeps a single RGB source and converts everything else so you can grab the precise code for every use case.

Supports 3, 6 or 8 digits (#RRGGBB, #RGB, #RRGGBBAA).

Format: rgb(r, g, b) or comma-separated (0–255).

Hue 0–360, Saturation & Lightness in %.

Approximation for print (0–100).

How to Use This Converter

Choose a color with the picker or edit any of the HEX, RGB, HSL, or CMYK fields. Every input is tied to the same RGB source, so clicking Calculate or waiting for the debounced update keeps the entire palette in sync.

Methodology

The editor normalizes the first valid input into an internal RGB triple, then derives the complementary codes with deterministic math. RGB is the reference for every conversion and is clamped to 0–255, so the UI never shows NaN or Infinity even when typing partial values.

  • “Live preview” mirrors the current RGB source to show the true color you are working with.
  • Contrast blocks paint the text on white and black to highlight accessibility differences.
  • Tints and shades are generated with fixed proportions to keep lighting increments predictable.
Results use standard conversion formulas. Figures are estimates; always confirm with design tools or color-proofed print proofs for critical work.

Full original guide (expanded)

How this color converter works

We keep a single “source” color internally as RGB, because it’s the easiest to convert to/from. Whenever you edit HEX, RGB, HSL or CMYK, we normalize the input, convert to RGB, and then re-compute every other format.

Supported formats

  • HEX: #RRGGBB or #RGB
  • RGB: either rgb(r, g, b) or comma-separated
  • HSL: hsl(0–360, 0–100%, 0–100%)
  • CMYK: 4 numbers 0–100 (approximation from RGB)

FAQ

1. Why can CMYK change slightly when I re-enter it?

CMYK → RGB → CMYK is not always perfectly reversible because CMYK is device-dependent. We generate a practical CMYK value for print designers starting from RGB.

2. Can I get Pantone?

This tool doesn’t output Pantone because it’s a proprietary library. Use your design software with the RGB/HEX we generate here.

3. Why HSL?

HSL is more intuitive to tweak in code and design systems: you can change just lightness to create tints, or saturation for muted variants.

Formulas

(Formulas preserved from original page content, if present.)

Citations

NIST — Weights and measures — nist.gov · Accessed 2026-01-19
https://www.nist.gov/pml/weights-and-measures

NIST — SI units — nist.gov · Accessed 2026-01-19
https://www.nist.gov/pml/owm/metric-si/si-units

Changelog
  • 0.1.0-draft — 2026-01-19 · Initial audit spec draft generated from HTML extraction (review required).
  • Verify formulas match the calculator engine and convert any text-only formulas to LaTeX.
  • Confirm sources are authoritative and relevant to the calculator methodology.
Verified by Ugo Candido Last Updated: 2026-01-19 Version 0.1.0-draft
Version 1.5.0