🔄

Color Converter (HEX, RGB, HSL, HSV, CMYK & WCAG Contrast

Conversion Free Instant Private
Conversion

### Color Spaces: HEX, RGB, HSL, CMYK & WCAG Accessibility Contrast Color science defines visual wavelengths across additive light (screens) and subtractive pigment (print) coordinate systems: -.

Reviewed by Sheraz Share · BSCS
Last updated:
Editorial Guidelines

⚙ Input Values

📊 Results

RGB Color String
rgb(37, 99, 235)
rgb
HSL Color String
hsl(221deg, 83%, 53%)
hsl
HSV / HSB Color String
hsv(221deg, 84%, 92%)
hsv
CMYK Print Color String
cmyk(84%, 58%, 0%, 8%)
cmyk
WCAG Contrast against White (#FFF)
5.17:1 (PASS AA)
:1
✦ Colorimetry & Web Accessibility Summary
Colorimetry Profile (#2563EB): RGB = rgb(37, 99, 235) | HSL = hsl(221deg, 83%, 53%) | HSV = hsv(221deg, 84%, 92%) | CMYK = cmyk(84%, 58%, 0%, 8%). Accessibility Analysis: Relative Luminance = 0.1532. Contrast with Pure White (#FFF) = 5.17:1 (PASS AA) (WCAG 2.1 requires ≥ 4.5:1 for normal text and ≥ 3.0:1 for large text). Color Space Rule: RGB (0-255) defines additive light for digital screens; CMYK (0-100%) defines subtractive pigment ink for commercial four-color process printing; HSL represents human-perceived Hue (0-360°), Saturation, and Lightness.
Embed on Your Website

Copy and paste this code into your website.

<iframe src="https://calcusolve.com/converter/color?embed=true" width="100%" height="600" frameborder="0" loading="lazy" title="Color Converter (HEX, RGB, HSL, HSV, CMYK & WCAG Contrast"></iframe>

📐 Formula

Formula Reference: Color Converter (HEX, RGB, HSL, HSV, CMYK & WCAG Contrast)
Input variables:
hexColorStringInput — HEX Color Code (#RRGGBB or #RGB)
Computed outputs:
formattedRgbString — RGB Color String
formattedHslString — HSL Color String
formattedHsvString — HSV / HSB Color String
formattedCmykString — CMYK Print Color String
wcagWhiteContrastRatio — WCAG Contrast against White (#FFF)
Mathematical relationships extracted from calculation logic:
s = s[0] + s[0] + s[1] + s[1] + s[2] + s[2]
rNorm = r / 255, gNorm = g / 255, bNorm = b / 255
h = 0, s = 0, l = (max + min) / 2
d = max - min
cPrime = 1 - (r / 255)
mPrime = 1 - (g / 255)
yPrime = 1 - (b / 255)
c = (cPrime - k) / (1 - k)
m = (mPrime - k) / (1 - k)
y = (yPrime - k) / (1 - k)
Standard: NIST Handbook 44 and BIPM SI unit definitions

💡 Practical Example

✅

A UI/UX designer creates a primary button with HEX #2563EB. Converting to RGB (37, 99, 235) and checking WCAG contrast against white text yields 5.27:1, confirming the design exceeds the 4.5:1 accessibility threshold.

📖 About Color Converter (HEX, RGB, HSL, HSV, CMYK & WCAG Contrast

Color Spaces: HEX, RGB, HSL, CMYK & WCAG Accessibility Contrast

Color science defines visual wavelengths across additive light (screens) and subtractive pigment (print) coordinate systems:

  • **
  • Core Color Space Transformations**:
  • HEX to RGB: Each 2 hex digits represent an 8-bit channel (0 to 255):

\#RRGGBB R = hex(RR), G = hex(GG), B = hex(BB)

  • RGB to CMYK (Subtractive Pigment):

K = 1 - (R', G', B'), C = (1 - R' - K) / (1 - K), M = (1 - G' - K) / (1 - K), Y = (1 - B' - K) / (1 - K)

where R', G', B' = R/255, G/255, B/255

  • RGB to HSL (Perceptual Cylinder):

L = ( + ) / (2), S = (Δ) / (1 - |2L - 1|)

  • **
  • W3C WCAG 2.1 Relative Luminance & Contrast Formula**:

L = 0.2126 · R_linear + 0.7152 · G_linear + 0.0722 · B_linear

Contrast Ratio = (L_1 + 0.05) / (L_2 + 0.05) (1:1 to 21:1)

  • **
  • Compliance Levels**:
  • WCAG AA Normal Text: 4.5:1
  • WCAG AA Large Text: 3.0:1
  • WCAG AAA Enhanced Normal Text: 7.0:1

How to Use This Calculator

Enter your HEX Color Code (#RRGGBB or #RGB) (e.g. #2563EB or 2563EB) and Design Palette & Brand Benchmark — choose from Custom HEX Color, Royal Blue (#2563EB) → RGB(37, 99, 235), Emerald Green (#10B981) → RGB(16, 185, 129). Results update instantly as you type — adjust any value to compare scenarios.

The Formula

Formula Reference: Color Converter (HEX, RGB, HSL, HSV, CMYK & WCAG Contrast)

Input variables:

hexColorStringInput — HEX Color Code (#RRGGBB or #RGB)

Computed outputs:

formattedRgbString — RGB Color String

formattedHslString — HSL Color String

formattedHsvString — HSV / HSB Color String

formattedCmykString — CMYK Print Color String

wcagWhiteContrastRatio — WCAG Contrast against White (#FFF)

Mathematical relationships extracted from calculation logic:

s = s[0] + s[0] + s[1] + s[1] + s[2] + s[2]

rNorm = r / 255, gNorm = g / 255, bNorm = b / 255

h = 0, s = 0, l = (max + min) / 2

d = max - min

cPrime = 1 - (r / 255)

mPrime = 1 - (g / 255)

yPrime = 1 - (b / 255)

c = (cPrime - k) / (1 - k)

m = (mPrime - k) / (1 - k)

y = (yPrime - k) / (1 - k)

Standard: NIST Handbook 44 and BIPM SI unit definitions

Worked Example

A UI/UX designer creates a primary button with HEX #2563EB. Converting to RGB (37, 99, 235) and checking WCAG contrast against white text yields 5.27:1, confirming the design exceeds the 4.5:1 accessibility threshold.

Understanding Your Result

Unit conversions are exact by definition within a given measurement system (e.g., 1 km = exactly 1,000 m). Cross-system conversions (metric to imperial) use defined exchange factors: 1 inch = exactly 2.54 cm; 1 pound = 0.45359237 kg. Round your converted result to match the precision of your original measurement — expressing more decimal places than your input justifies implies false accuracy. For regulatory, legal, or safety-critical applications, verify which measurement system is required by the applicable standard.

💡 Methodological Standards & Calculation Accuracy

  • All calculations are performed client-side in your browser using verified, standards-compliant mathematical algorithms.
  • Results are provided for educational and informational analysis; verify critical applications with certified domain specialists.
  • Ensure input values are entered in consistent units matching the selector options to guarantee accurate outputs.
  • Periodic recalibration is recommended whenever baseline assumptions, operating parameters, or external conditions change.

Results are for informational and educational purposes only. Always verify critical decisions with a qualified professional.

❓ Frequently Asked Questions

How do you convert a HEX color to RGB?

Split the 6-digit hex string into 3 pairs: RR, GG, BB. Convert each hexadecimal pair into its decimal value (0 to 255). For example, #2563EB: 25₁₆ = 37, 63₁₆ = 99, EB₁₆ = 235, giving rgb(37, 99, 235).

What is the difference between RGB and CMYK?

RGB (Red, Green, Blue) is an additive color model used for illuminated digital screens (where combining all colors creates white). CMYK is a subtractive model used for physical ink printing (where inks absorb light).

What is the WCAG AA contrast ratio requirement for web text?

WCAG 2.1 Level AA requires a contrast ratio of at least 4.5:1 for standard body text and at least 3.0:1 for large text and user interface components.

What does HSL stand for and why is it useful?

HSL stands for Hue (0-360° on the color wheel), Saturation (0-100% color purity), and Lightness (0-100% brightness). HSL makes it intuitive to create matching tints, shades, and monochromatic color palettes by simply adjusting lightness.

What is the maximum contrast ratio possible?

The maximum contrast ratio is 21:1, which occurs between pure black (#000000) and pure white (#FFFFFF).

Try Other Calculators