Skip to content

HEX to Decimal Color

Convert a HEX colour to the integer forms Android, Java and Unity want.

The colour

Integer forms
The values appear here

Quick Tool Overview

HEX to Decimal Color turns a colour into every integer form a platform might want: decimal channels, the packed 24-bit value, the 32-bit ARGB integer signed and unsigned, and normalised floats for shaders.

What it does
Converts a HEX colour to integer and float forms
You give it
A HEX code, or an integer to reverse
You get back
Every packed form, labelled by platform
Best for
Android, Java, Unity and shader work
Color Tools Free, unlimited use No sign-up Runs in your browser

About the HEX to Decimal Color

Plenty of environments want a colour as a single number rather than a string. Android takes a signed 32-bit ARGB integer, Java AWT takes an unsigned RGB one, Unity and many game engines take 0–1 floats, and shaders take normalised vectors.

This converts a HEX code into all of them at once: the three channels in decimal, the packed 24-bit RGB integer, the 32-bit ARGB value in both signed and unsigned form, and the float triple with as many digits as you need.

The signed form is the one that causes trouble. Any colour with an alpha above 50% has the top bit of the 32-bit value set, which in a signed integer means it is negative — which is why Android colours so often appear as large negative numbers in logs. Both forms are shown side by side so it is clear they are the same 32 bits read two ways.

Key features of the HEX to Decimal Color

The negative number explained

Android colours appear negative because the top alpha bit is set in a signed int. Both readings are shown as the same 32 bits.

ARGB and RGBA kept apart

Android puts alpha first, CSS puts it last. Getting it backwards gives the wrong transparency, so both are labelled explicitly.

Normalised floats

The 0–1 triple Unity, OpenGL and shaders expect, with a note about linear versus sRGB.

Reverses too

Paste an integer from a log or a config file and get the colour back.

Platform labels

Each form says which environment wants it, so there is no guessing which number to copy.

How to use the HEX to Decimal Color

  1. 1

    Enter a HEX colour

    Six or eight digits — the alpha is used for the ARGB forms.

  2. 2

    Read every integer form

    Decimal channels, packed RGB, signed and unsigned ARGB, and normalised floats.

  3. 3

    Copy the one you need

    Each is labelled with the platform that expects it.

  4. 4

    Or convert back

    Paste an integer and get the HEX code it represents.

Frequently asked questions

Because Color.parseColor returns a signed 32-bit integer, and any colour that is more than half opaque sets the top bit. 0xFF4F46E5 is -11774235 when read as signed. It is the same value, read differently.

Reviews of the HEX to Decimal Color

What people who use the HEX to Decimal Color think of it. Reviews come from visitors and are posted as written.

No ratings yet

Yours would be the first.

  • 5 0 reviews rated 5 stars
  • 4 0 reviews rated 4 stars
  • 3 0 reviews rated 3 stars
  • 2 0 reviews rated 2 stars
  • 1 0 reviews rated 1 star

Write a review

Used this tool? Your rating helps the next person decide.

Your rating

Plain text only — links, email addresses and HTML are not accepted. Your name and review are shown publicly; nothing else is collected. See the privacy policy.

0 reviews

Newest first

No reviews yet

Be the first to rate the HEX to Decimal Color. It takes half a minute and no account.

Write the first review

More color tools