🎨 HEX to RGB

Paste a hex code from a design file and get rgb() values ready for CSS, Android or Swift.

🔒 Runs in your browser · files never uploaded

Contrast (WCAG 2.x)

How to use the HEX to RGB tool

  1. Paste a hex code with or without #.
  2. Copy the rgb() value – or HSL, HSV and CMYK.
  3. Check the swatch and contrast badges.

Frequently asked questions

How do I convert hex to RGB by hand?

Split the six digits into pairs and convert each from base 16: #FF8000 → FF=255, 80=128, 00=0 → rgb(255, 128, 0).

What does a 3-digit hex code mean?

It is shorthand where each digit is doubled: #f60 equals #ff6600. 4-digit (#f60c) and 8-digit (#ff6600cc) forms add an alpha channel.

How do I use the result in Swift or Android?

Divide each RGB value by 255 for UIColor(red:green:blue:alpha:). Android XML accepts #AARRGGBB – note alpha comes first there, unlike CSS #RRGGBBAA.

Related tools