Color Code Converter

/convert/

HEX · RGB · HSL · HSV · CMYK · WCAG Contrast Checker · Color Harmonies

#6366F1
Red:99
Green:102
Blue:241
Hue:239°
Saturation:84%
Lightness:67%
HEX
#6366F1
RGB
rgb(99, 102, 241)
RGBA
rgba(99, 102, 241, 1)
HSL
hsl(239, 84%, 67%)
HSV / HSB
hsv(239, 59%, 95%)
CMYK
cmyk(59%, 58%, 0%, 5%)
CSS Variable
--primary: #6366f1;
Android XML
<color name="primary">#6366F1</color>
Swift UIColor
UIColor(red: 0.39, green: 0.40, blue: 0.95, alpha: 1.0)

👁️WCAG Accessibility Contrast Ratings

Text on Pure White:
4.47 : 1
AA Normal: FAILAAA Normal: FAIL
Text on Pure Black:
4.7 : 1
AA Normal: PASSAAA Normal: FAIL

🎨Color Harmonies & Palettes

Complementary (180°)
Analogous (±30°)
Triadic (120°)
Tetradic (90°)

🪜Tints (Lighter) & Shades (Darker)

Lighter Tints:
Darker Shades:

What is Color Code Conversion and Why Does Color Space Accuracy Matter?

Digital color representation is governed by distinct color models tailored to specific rendering hardware, print media, and human perception. Web browsers and mobile operating systems utilize the sRGB color space via Hexadecimal (HEX) and Red-Green-Blue (RGB) coordinate systems, specifying intensity values from 0 to 255 across optical display subpixels.

Designers and front-end engineers frequently switch between HSL (Hue, Saturation, Lightness) and HSV (Hue, Saturation, Value) because cylindrical coordinate representations make creating color variations, hover states, and dynamic theme tokens significantly more intuitive than manipulating raw RGB channels. For print design and prepress production, conversion to CMYK (Cyan, Magenta, Yellow, Key/Black) provides estimated ink densities required for physical subtractive color synthesis.

Beyond visual appeal, color contrast is a mandatory standard under the Web Content Accessibility Guidelines (WCAG 2.1). Digital products must maintain a minimum contrast ratio of 4.5:1 for normal text (AA standard) and 7:1 for enhanced legibility (AAA standard). LocalDevTools computes mathematical luminance and contrast ratios instantaneously 100% inside your local browser, allowing you to test sensitive design systems and private brand identities with zero server transmission.

How to Use This Color Code Converter

  1. Select or paste your color: Click the live color preview square to open the system picker, or type any valid HEX (e.g. #4F46E5), RGB (e.g. rgb(79, 70, 229)), or HSL code directly into the input field.
  2. Inspect multi-space values: View synchronized conversions across HEX, RGB, RGBA, HSL, HSLA, HSV, and CMYK formats alongside ready-to-paste CSS variables.
  3. Check WCAG accessibility: Review the real-time contrast ratio badges against pure white (#FFFFFF) and pure black (#000000) to confirm AA and AAA accessibility compliance for normal and large text.
  4. Explore harmonic palettes: Scroll to inspect generated complementary, analogous, triadic, and tetradic color schemes, or copy tints and shades from the 10-step luminance ladder.

Frequently Asked Questions (FAQ)

What is the difference between HEX, RGB, and HSL? ↓

HEX is a base-16 shorthand representation of RGB (e.g., #FF0000 is 255 red, 0 green, 0 blue). RGB specifies primary light intensities directly. HSL organizes colors cylindrically by Hue (angle 0–360°), Saturation (percentage of color purity), and Lightness (percentage from black to white), making it ideal for systematic color palette generation.

How are WCAG 2.1 contrast ratios calculated? ↓

WCAG calculates contrast using relative luminance: (L1 + 0.05) / (L2 + 0.05), where L1 is the lighter color and L2 is the darker color. The ratio ranges from 1:1 (zero contrast) to 21:1 (black on white). Level AA requires 4.5:1 for standard body text and 3:1 for large text (18pt or 14pt bold).

Why do CMYK values differ between screen preview and commercial printing? ↓

Screens use additive RGB light emission, which has a wider gamut than subtractive CMYK ink absorption on paper. The CMYK percentages provided by LocalDevTools use standard mathematical sRGB transformation; professional offset printing requires ICC profile soft-proofing in design software.

Can I copy the values directly into CSS or Tailwind? ↓

Yes. Every color space card includes a 1-click copy button that places the exact CSS string (such as hsl(243, 75%, 59%) or #4f46e5) straight into your clipboard.