Beta Notice: TONTUF Tools is currently in public beta — we're actively refining features, squashing bugs, and rolling out new tools. Your feedback helps us improve!

HEX Color Conversion Tool (HEX to RGB, HSL & CMYK)

Conversion Results

RGB: -
HSL: -
CMYK: -

Conversion Formulas (Simplified)

HEX to RGB: Convert each pair of HEX values (R, G, B) to decimal values using base-16.
RGB to HSL: - H = Hue (angle of color on color wheel) - S = Saturation (intensity of color) - L = Lightness (brightness of color) Formula calculates based on max/min values of R, G, B.
RGB to CMYK: - C = Cyan - M = Magenta - Y = Yellow - K = Key (black) Convert RGB values to percentages and derive CMYK values based on complementarity.

Brightness & Saturation Adjustments

Color Distribution (RGB)

Red: 0%
Green: 0%
Blue: 0%

Sample HEX Colors

ColorHEX
#FF0000
#00FF00
#0000FF
#FFFF00
#FF00FF
#00FFFF
#808080
#800000
#008000
#808000


1. HEX to RGB Conversion

Formula

HEX is a 6-digit hexadecimal value representing red, green, and blue (R, G, B). Each pair of digits corresponds to a value between 0-255.

  1. Split the HEX code into pairs:

    • First two characters = Red (R)
    • Next two characters = Green (G)
    • Last two characters = Blue (B)
  2. Convert each pair from hexadecimal (base-16) to decimal (base-10).

Example

HEX Code: #4CAF50

  1. Split into pairs:

    • Red = 4C
    • Green = AF
    • Blue = 50
  2. Convert to decimal:

    • 4C → ( 4 \times 16 + 12 = 76 )
    • AF → ( 10 \times 16 + 15 = 175 )
    • 50 → ( 5 \times 16 + 0 = 80 )

Result: RGB(76, 175, 80)


2. RGB to HSL Conversion

Formula

HSL stands for Hue, Saturation, and Lightness:

  • Hue (H): Angle on the color wheel (0° to 360°).
  • Saturation (S): Intensity of the color (0% to 100%).
  • Lightness (L): Brightness of the color (0% to 100%).

Steps:

  1. Normalize RGB values to a range of 0-1:
    ( R{norm} = R/255, \, G{norm} = G/255, \, B_{norm} = B/255 )

  2. Calculate max and min values:
    ( \text{max} = \max(R{norm}, G{norm}, B{norm}) )
    ( \text{min} = \min(R
    {norm}, G{norm}, B{norm}) )

  3. Compute Lightness (L):
    ( L = (\text{max} + \text{min}) / 2 )

  4. Compute Saturation (S):

    • If ( \text{max} = \text{min} ), ( S = 0 ) (grayscale).
    • Otherwise,
      ( S = \frac{\text{max} - \text{min}}{1 - |2L - 1|} )
  5. Compute Hue (H):

    • If ( \text{max} = R{norm} ):
      ( H = 60 \times ((G
      {norm} - B_{norm}) / (\text{max} - \text{min})) + 360 ) (mod 360)
    • If ( \text{max} = G{norm} ):
      ( H = 60 \times ((B
      {norm} - R_{norm}) / (\text{max} - \text{min})) + 120 )
    • If ( \text{max} = B{norm} ):
      ( H = 60 \times ((R
      {norm} - G_{norm}) / (\text{max} - \text{min})) + 240 )

Example

RGB: ( (76, 175, 80) )

  1. Normalize:
    ( R{norm} = 76 / 255 = 0.298, \, G{norm} = 175 / 255 = 0.686, \, B_{norm} = 80 / 255 = 0.314 )

  2. Max = 0.686, Min = 0.298
    ( L = (0.686 + 0.298) / 2 = 0.492 )

  3. Saturation: ( S = \frac{0.686 - 0.298}{1 - |2 \times 0.492 - 1|} = 0.579 ) (57.9%)

  4. Hue: ( H = 60 \times \frac{(0.686 - 0.314)}{0.686 - 0.298} + 360 ) (mod 360)
    ( H = 123° )

Result: HSL(123°, 57.9%, 49.2%)


3. RGB to CMYK Conversion

Formula

CMYK stands for Cyan, Magenta, Yellow, and Key (Black). The formula converts RGB into percentages for printing.

Steps:

  1. Normalize RGB to a 0-1 range:
    ( R{norm} = R/255, \, G{norm} = G/255, \, B_{norm} = B/255 )

  2. Compute Key (K):
    ( K = 1 - \max(R{norm}, G{norm}, B_{norm}) )

  3. Compute Cyan (C), Magenta (M), and Yellow (Y):

    • ( C = \frac{1 - R_{norm} - K}{1 - K} )
    • ( M = \frac{1 - G_{norm} - K}{1 - K} )
    • ( Y = \frac{1 - B_{norm} - K}{1 - K} )

If ( K = 1 ), then ( C = M = Y = 0 ).

Example

RGB: ( (76, 175, 80) )

  1. Normalize:
    ( R{norm} = 76 / 255 = 0.298, \, G{norm} = 175 / 255 = 0.686, \, B_{norm} = 80 / 255 = 0.314 )

  2. Compute Key (K):
    ( K = 1 - \max(0.298, 0.686, 0.314) = 0.314 )

  3. Compute Cyan (C):
    ( C = \frac{1 - 0.298 - 0.314}{1 - 0.314} = 0.702 ) (70.2%)

  4. Compute Magenta (M):
    ( M = \frac{1 - 0.686 - 0.314}{1 - 0.314} = 0.000 ) (0%)

  5. Compute Yellow (Y):
    ( Y = \frac{1 - 0.314 - 0.314}{1 - 0.314} = 0.500 ) (50%)

Result: CMYK(70.2%, 0%, 50%, 31.4%)


Summary Table of Example Conversions

HEX RGB HSL CMYK
#4CAF50 RGB(76, 175, 80) HSL(123°, 57.9%, 49.2%) CMYK(70.2%, 0%, 50%, 31.4%)

This step-by-step breakdown helps you to understand exactly how your HEX color codes are converted into other formats!

Post a Comment

0 Comments





The best solution for online tools

Trusted by thousands of users worldwide for fast, reliable, and free utilities.

10 million+

tools used last year

35 000+
Monthly Active Users
40+
Tool Categories
5 000+
Daily Tool Runs
250%
Yearly Growth
99,9%
Uptime Guarantee

Ready to Supercharge Your Workflow?

Join thousands of satisfied users who rely on TONTUF Tools every day. Start exploring our growing collection of 100+ free online tools — no signup required.


What Users Say

A

Alex Rivera

Web Developer

"TONTUF Tools has been my go-to resource for quick online utilities. The SEO analyzer alone saved me hours of manual work!"

★★★★★
S

Sarah Chen

Content Creator

"I use the image and downloader tools daily. Clean interface, fast results, and absolutely free. Highly recommended!"

★★★★★
M

Michael Okafor

Digital Marketer

"The collection of SEO and finance tools is incredible. Everything I need in one place, and it keeps growing. Love the Python tools too!"

★★★★☆

FAQ

Frequently Asked Questions

Quick answers to the most common questions about TONTUF Tools and how everything works.

Yes, every tool on TONTUF Tools is 100% free with no hidden charges, subscriptions, or usage limits. We believe in making useful utilities accessible to everyone.

All tools run entirely on your device. Your files and data never leave your browser — we never store, upload, or share anything you process through our tools.

No account or sign-up is required. Just visit the site, pick a tool, and start using it instantly. No registration, no emails, no hassle.

We welcome suggestions! Reach out through our Contact Us page or connect with us on social media. We regularly add new tools based on user feedback.

TONTUF Tools works on all modern browsers — Chrome, Firefox, Edge, Safari, and Opera — across desktop, tablet, and mobile devices.

Created with by F9XR Team