#1 India's Top IT Training Institute

×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →
⚡ FREE · INSTANT RESULT

HEX to RGB Converter: Every Colour Format at Once

Convert a colour between HEX, RGB, HSL and CMYK.

  • 🎨 HEX, RGB, HSL, CMYK
  • 👁️ Colour preview
  • ♿ Contrast check

How to use the HEX to RGB Converter

  1. 1. Enter a colourType HEX, RGB or HSL, such as #ff5421.
  2. 2. Convert itThe tool reads the format on its own.
  3. 3. Copy the codeSee every format and how text looks against it.

How HEX becomes RGB

A HEX colour is three pairs of hexadecimal digits for red, green and blue. Each pair runs from 00 to FF, which is 0 to 255 in decimal. So for #ff5421:

  • ff is 15×16 + 15 = 255 red.
  • 54 is 5×16 + 4 = 84 green.
  • 21 is 2×16 + 1 = 33 blue.

The result is rgb(255, 84, 33), which is hsl(14, 100%, 56%). Short codes double each digit, so #abc means #aabbcc. An 8-digit code adds transparency as the last pair.

HSL is often easier for design work. To make a lighter shade, you only raise the last number and leave the colour itself alone. Want to see the maths on other values? Try the number system converter.

Why the contrast check matters

A colour can look great and still be hard to read as a background. The web accessibility guidelines (WCAG) use a contrast ratio from 1:1 to 21:1, and level AA asks for at least 4.5:1 for normal text.

This tool measures your colour against white and black text and tells you whether each pair passes. Our sample orange has about 3.2:1 with white text, so white body text on it fails AA, while black text passes. Large headings have a lower bar of 3:1.

The CMYK values come from a simple formula and do not take account of paper or ink, so treat them as a starting point and ask your printer for exact values.

Picked your colours? Blend them with the CSS gradient generator, and the code is ready to paste into your stylesheet.

Frequently asked questions

Which colour formats can I enter?

HEX with 3, 4, 6 or 8 digits, rgb() and rgba(), and hsl() and hsla(). The # sign is optional.

What does AA mean in the contrast result?

It is a WCAG accessibility level. Normal text needs a contrast ratio of at least 4.5 to 1 to pass.

Are the CMYK values exact for print?

No. They come from a simple conversion. Ask your printer for colour-managed values.

Is this tool free?

Yes, it is free. We ask for your name and WhatsApp number once when you see your result, and other Uncodemy tools then open without the form.

More free tools

See all free tools