nrtechstudio.com
HEX · RGB · HSL · HSV · CMYK · Lab

Color Converter

Type or paste any color — a HEX code, rgb(), hsl(), a CSS name — and get every format at once, plus palettes, a WCAG contrast checker, and an image eyedropper. Everything runs in your browser; nothing is uploaded.

Convert between all formats

Edit any field — every other format recalculates live, in both directions. Alpha is supported via 8-digit HEX, rgba() and hsla().

HEX
#FF5733 · #FF5733FF with alpha
RGB
rgb(255, 87, 51)
HSL
hsl(11, 100%, 60%)
HSV
hsv(11, 80%, 100%)
CMYK
cmyk(0%, 66%, 80%, 0%)
Lab
lab(60.2 62.1 54.3) · D65
Visual picker
…or drag the sliders
255
87
51
1.00

Palette generator

Seven classic color schemes built from your current color. Click any swatch to copy its HEX code.

WCAG contrast checker

Test any text/background pair against the official WCAG 2.x relative-luminance formula — the same math accessibility auditors use.

Text color
Background color
Contrast ratio
3.15 : 1
AA normal · 4.5:1 AA large · 3:1 AAA normal · 7:1 AAA large · 4.5:1

Image eyedropper

Upload a photo, logo, or screenshot, then click any pixel to load that exact color into the converter. The image never leaves your device.

Name & export

The closest CSS named color (by perceptual Lab distance), plus ready-to-paste code for your project.

Nearest named color
tomato
#FF6347 · Δ –

Worked examples

Real conversions with the arithmetic shown — the same steps the tool performs internally.

Example 1 — Convert #FF5733 to every format

  1. HEX → RGB: split into pairs — FF=15×16+15=255, 57=5×16+7=87, 33=3×16+3=51 → rgb(255, 87, 51).
  2. Normalize to 0–1: (1.0, 0.3412, 0.2). max=1.0, min=0.2, Δ=0.8.
  3. → HSL: L=(1.0+0.2)/2=0.60 → 60%; S=0.8/(1−|1.2−1|)=1.00 → 100%; H=60×((0.3412−0.2)/0.8)=10.59° → hsl(11, 100%, 60%).
  4. → HSV: V=max=1.0 → 100%; S=Δ/max=0.8 → 80% → hsv(11, 80%, 100%).
  5. → CMYK: K=1−1.0=0; M=(1−0.3412)/1=65.88% → 66%; Y=(1−0.2)=80% → cmyk(0%, 66%, 80%, 0%).
  6. → Lab (D65): linearize sRGB → XYZ matrix → cube-root compression → lab(60.2 62.1 54.3).

Example 2 — Accessible palette from #2E86AB

  1. Find the hue: #2E86AB = rgb(46, 134, 171) → hue 197.76°.
  2. Complementary accent: 197.76°+180°=17.76° at the same saturation/lightness → #AB532E (burnt orange).
  3. Check text contrast on the #2E86AB background: white text = 4.11:1 (fails AA for normal text), black text = 5.11:1 (passes AA). → Use black text.
  4. Result: deep-teal background + black text + burnt-orange accent — harmonious and WCAG AA compliant.

Example 3 — Designer handoff: hsl(210, 50%, 40%) → code + print estimate

  1. HSL → RGB: C=(1−|0.8−1|)×0.5=0.4; X=0.4×(1−|3.5 mod 2−1|)=0.2; m=0.4−0.2=0.2. Hue 210° falls in sector 3–4, so (R′,G′,B′)=(0, X, C). Add m and scale: (51, 102, 153) → #336699.
  2. Print estimate: K=1−0.6=40%; C=(1−0.2−0.4)/0.6=66.7% → cmyk(67%, 33%, 0%, 40%) — a starting point for the brief, not a prepress value.
  3. Ship it: export as :root { --brand: #336699; } with one click above.

How the math works

Every formula the tool uses, stated plainly so you can verify the results by hand.

HEX ↔ RGB

Hexadecimal is base 16 with two digits per channel: #RRGGBB → R=16×d1+d2. Shorthand #RGB doubles each digit (#F53 → #FF5533). 8-digit #RRGGBBAA appends alpha as 00 (transparent)…FF (opaque).

RGB → HSL / HSV

Let max/min be the largest/smallest of normalized R, G, B and Δ=max−min. Hue is shared: 60°×((G−B)/Δ mod 6) when red dominates, with the analogous forms for green/blue. HSL: L=(max+min)/2, S=Δ/(1−|2L−1|). HSV: V=max, S=Δ/max. The reverse direction reconstructs chroma C, second component X, and match value m per hue sector.

RGB ↔ CMYK

K=1−max(R,G,B); C=(1−R−K)/(1−K), M and Y likewise. This is the naive conversion — the same one quick online tools use. Real print workflows add ICC profiles, ink limits, and black generation, which is why a screen proof and a press proof can disagree.

RGB ↔ Lab

sRGB is linearized (γ≈2.2 piecewise), multiplied by the standard sRGB→XYZ matrix, then compressed with a cube root against the D65 white point (95.047, 100, 108.883) to yield L*, a*, b*. Converting Lab back to RGB clips out-of-gamut values to the nearest displayable color — disclosed wherever it applies.

WCAG contrast ratio

Relative luminance L=0.2126R+0.7152G+0.0722B on linearized channels (WCAG threshold 0.03928). Ratio=(Llighter+0.05)/(Ldarker+0.05). Black on white gives exactly 21:1 — the theoretical maximum.

Scope note — where this tool ends and the focused tools begin

This page (#300) is the hub: every format in both directions, seven palette schemes, a WCAG contrast checker, an image eyedropper, named-color lookup, and CSS export. The legacy single-purpose utilities remain the fastest choice for one tiny job and are linked below: hex-to-hsl, hsl-to-hex, hsv-to-hex, rgb-to-hsv, cmyk-to-hex, cmyk-code, colour-rgb-values, dec-to-hex-color, color-shade-gen, define-split-complementary-colors, and gradient-color-combination. Same math, different intent: hub for exploration, focused tools for a single conversion.

Privacy: this page makes zero external requests. Conversions, palettes, contrast checks, and image sampling all run as JavaScript in your browser — your colors never leave your device.

Frequently asked questions

How do I convert HEX to RGB?

Split the six hex digits into three pairs — each pair is one channel in base 16. For #FF5733: FF = 255 (red), 57 = 87 (green), 33 = 51 (blue), so the result is rgb(255, 87, 51). Paste any HEX code into the converter above and every other format updates instantly, including the reverse direction.

What is the difference between HSL and HSV?

Both describe color with a hue angle (0-360°), but they define “saturation” differently. HSL uses Saturation + Lightness and is the format CSS understands, which makes it handy for hand-tweaking stylesheets. HSV (also called HSB) uses Saturation + Value/Brightness and is the model Photoshop-style color pickers use. Same hue, different second and third numbers: #FF5733 is hsl(11, 100%, 60%) but hsv(11, 80%, 100%).

How do I find the complementary color of any color?

Add 180° to the hue. #FF5733 sits at hue 10.6°, so its complement is at 190.6° → #33DBFF. The palette generator above does this automatically, along with analogous (±30°), triadic (±120°), split-complementary, tetradic, square, and monochromatic schemes.

What is a good contrast ratio for text?

WCAG 2.x defines three bars: 4.5:1 for normal text at AA (the legal baseline most teams target), 3:1 for large text (18pt+ or 14pt bold) at AA, and 7:1 for AAA. The contrast checker above computes the exact ratio with the official relative-luminance formula and shows which levels pass. Example: white text on #FF5733 is only 3.15:1 (fails AA), while black text on #FF5733 is 6.66:1 (passes AA).

Why does my CMYK print look different from the screen?

Screens emit light (RGB) while paper absorbs it (CMYK ink), and the CMYK gamut is much smaller — many vivid screen colors simply cannot be printed. The CMYK values here use the standard naive formula, which is a solid estimate but not a true ICC-profile conversion with black generation, so treat them as a starting point and always request a proof from your print shop for brand-critical work.

How do I convert RGB to CMYK without Photoshop?

Paste the RGB value into the converter (it accepts rgb(255, 87, 51), “255, 87, 51”, or #FF5733) and read the CMYK row — for #FF5733 that is cmyk(0%, 66%, 80%, 0%). The math: K = 1 − max(R,G,B), then each of C, M, Y = (1 − channel − K) / (1 − K). Everything runs in your browser; no software to install.

What does the alpha channel in 8-digit HEX (#RRGGBBAA) mean?

The last two digits are opacity in hex: 00 is fully transparent, FF is fully opaque. #FF573380 is #FF5733 at 50.2% opacity, equivalent to rgba(255, 87, 51, 0.5). This tool reads and writes 8-digit (and 4-digit shorthand) hex, and the RGB/HSL cards show the matching rgba()/hsla() strings.

How do I expand shorthand HEX like #F53?

Double each digit: #F53 becomes #FF5533. Four-digit shorthand works the same way for alpha: #F538 → #FF553388. The converter accepts 3, 4, 6, and 8-digit hex with or without the # prefix and normalizes everything to the full form.

What is Lab color and when should I use it?

CIELAB is a perceptually uniform color space: L* is lightness (0-100), a* runs green-to-red, b* runs blue-to-yellow. Equal numeric steps look like equal visual steps, which is why this tool uses Lab distance to find the nearest named color. Note the honest limitation: some Lab values fall outside the sRGB gamut, so converting them back to RGB clips to the nearest displayable color.

How is this different from single-purpose converters like hex-to-rgb or rgb-to-hsv tools?

Those are one-function utilities — this page is the hub. One input updates HEX, RGB, HSL, HSV, CMYK, and Lab in both directions, plus a color picker with sliders, seven palette schemes, a WCAG contrast checker, an image eyedropper, nearest-named-color lookup, and CSS export. If you only need one tiny conversion, the focused tools (hex-to-hsl, hsl-to-hex, hsv-to-hex, rgb-to-hsv, cmyk-to-hex, dec-to-hex-color, color-shade-gen) are linked below and remain the fastest option for that single job.

Can I pick a color from an uploaded image?

Yes. Upload any image in the eyedropper section and click (or tap) any pixel — the exact color loads into the converter with all formats computed. The image is drawn to an off-screen canvas locally and is never uploaded anywhere.

Does this tool send my colors to a server?

No. The entire tool is a single self-contained page: every conversion, palette, contrast check, and image sample runs in JavaScript inside your browser with zero external requests. It keeps working offline once loaded, and there is nothing to sign up for.

How do I copy colors as CSS variables?

The export panel generates ready-to-paste code from your current color and palette, e.g. :root { --brand: #FF5733; --brand-rgb: 255, 87, 51; } plus rgb()/hsl() fallbacks and a Tailwind-style snippet. Each format card also has its own one-click copy button.

What are analogous and triadic color schemes used for?

Analogous schemes (hue ±30°) sit next to each other on the wheel and feel calm and cohesive — ideal for backgrounds and gradients. Triadic schemes (hue ±120°) are evenly spaced and feel vibrant but balanced — ideal when you need three distinct accents, like charts or category colors. Complementary pairs (±180°) give maximum pop for calls to action.

Which text color should I use on a colored background?

Pick whichever of black or white gives the higher contrast ratio — the checker suggests it automatically. As a rule of thumb, light saturated colors like #FF5733 take black text (6.66:1, passes AA), while deep colors like #2E86AB also take black text here (5.11:1 vs 4.11:1 for white — white fails AA normal text). When in doubt, test the exact pair instead of guessing.

How accurate is the CMYK conversion here?

It uses the standard naive RGB↔CMYK formula, which every quick online converter uses. It is accurate as an estimate for specs, mockups, and briefs, but it is not a prepress conversion: real print workflows apply ICC profiles, total-ink limits, and black generation that shift the numbers. For anything going to a commercial press, confirm with your printer’s profile.

Free tool by NRTechStudio