HEX to Jetpack Compose Color Converter
Convert HEX colors into Jetpack Compose Color values for Android apps.
About This Tool
This HEX to Jetpack Compose Color converter turns standard RGB and ARGB hex values into Kotlin Color code for Android and Jetpack Compose projects.
The conversion runs locally in your browser. Your color values are not uploaded to a server.
Benefits and Use Cases
- Convert design-system colors into Compose
Colorvalues - Generate opaque RGB colors with the correct
FFalpha prefix - Preserve alpha values from 4-digit and 8-digit ARGB colors
- Preview the selected color before copying the generated code
- Copy ready-to-use Kotlin code into a Compose theme or UI file
How to Use
- Enter a 3, 4, 6, or 8-digit HEX color.
- Click
Generate Color. - Review the preview and generated
Color(0xAARRGGBB)code. - Copy the result into your Android project.
Android Example
For the HEX value #6750A4, the tool generates:
Color(0xFF6750A4)The FF prefix represents full opacity. An ARGB value such as #806750A4 keeps its alpha channel:
Color(0x806750A4)Frequently Asked Questions
Which HEX formats are supported?
The converter supports 3-digit and 6-digit RGB values, plus 4-digit and 8-digit ARGB values.
Why does a six-digit color receive an FF prefix?
Jetpack Compose uses the 0xAARRGGBB format. FF means the color is fully opaque.
Is my color value uploaded?
No. The conversion happens locally in your browser.
Can I use the generated code in a Compose theme?
Yes. Add the generated expression to your color definitions, such as a Color constant in a theme file.