Color Converter: HEX, RGB, HSV, Swift & Kotlin

Enter a HEX code or pick a color. Get values and ready-to-paste code for web, iOS and Android.

Aa sample text

Runs entirely in your browser. Nothing you enter is sent or stored.

How to use

  1. Type a HEX code (#RGB, #RRGGBB or 8 digits) or use the picker.
  2. Choose how 8-digit codes are read: ARGB (iOS/Android) or RGBA (CSS).
  3. Copy the format you need.

Designers hand over colors as HEX codes, but iOS, Android and CSS each want them written differently. This color converter takes a HEX value — #RGB, #RRGGBB or 8 digits — or a pick from the color picker, and outputs HEX, rgb(), rgba(), HSV, a CSS #RRGGBBAA code, a Swift UIColor, a SwiftUI Color, a Kotlin Color(0xAARRGGBB) and an Android <color> resource, all ready to copy.

Three-digit codes are expanded by repeating each digit, so #ABC becomes #AABBCC. For 8-digit codes you choose the alpha position: ARGB, used by Android and many iOS helpers, or RGBA, used by CSS. Swift values are channel ÷ 255 rounded to three decimals. The brightness shown uses the YIQ weights (R×299 + G×587 + B×114) ÷ 1000 on a 0–1 scale; above 0.5 the color counts as light and dark text is suggested, otherwise white text.

Limits: the 4-digit #RGBA shorthand is not read, so use 8 digits instead. The color picker sets only RGB, so choosing a color resets alpha to opaque. HSV values are rounded to whole numbers, and the tool does not convert between color spaces such as Display P3 and sRGB. Characters that are not hex digits, including #, are ignored. The conversion runs entirely in your browser and nothing is sent anywhere.

Frequently asked questions

What is the difference between #AARRGGBB and #RRGGBBAA?

Android and many iOS helpers put alpha first (AARRGGBB). CSS puts alpha last (RRGGBBAA). Pick the order that matches where your code came from.

How is the text color chosen?

Brightness uses the YIQ formula (R×299 + G×587 + B×114) ÷ 1000. Above 0.5 the color is light, so dark text is suggested; otherwise white text.

Does 3-digit HEX work?

Yes. #ABC expands to #AABBCC.

Related tools