Convert a whole number between hexadecimal and decimal, and inspect its binary and octal equivalents. The place-value table explains how the hexadecimal digits contribute to the decimal magnitude.
How to enter a number
Choose Hex to decimal and enter digits such as FF, 0x2A, or -80. Choose Decimal to hex for an integer such as 255 or -128. A leading plus or minus sign is allowed. Use at most 256 digits and omit commas, spaces inside the number, and decimal points.
Leading zeros do not change the value and are removed from the result. Hexadecimal output uses uppercase letters. Zero has a displayed magnitude bit length of one.
Understanding the outputs
Each output represents the same signed integer in a different base. Decimal uses ten symbols, hexadecimal sixteen, binary two, and octal eight. The bit length counts digits needed to represent the absolute value in binary; it is not a signed storage-width recommendation.
The place-value table expands the hexadecimal magnitude from its highest power of sixteen to its lowest. For a negative number, sum those positive contributions, then apply the minus sign to the total.
Examples
Convert hexadecimal 2AF
2AF means 2 × 16² + 10 × 16¹ + 15 × 16⁰. The contributions are 512, 160, and 15, so the decimal result is 687. Its binary representation is 1010101111.
Convert decimal 255
255 is FF in hexadecimal, 11111111 in binary, and 377 in octal. The magnitude needs eight binary digits. Adding a minus sign gives −255, represented here as −FF.
Formula
For hexadecimal digits d at positions k, with the rightmost position numbered zero:
Decimal magnitude = sum of (digit value × 16^position)
A = 10, B = 11, C = 12, D = 13, E = 14, F = 15
To convert decimal to hexadecimal by hand, repeatedly divide the magnitude by 16 and read the remainders in reverse order.
Signed values and computer storage
A stored bit pattern only has a signed interpretation when its width and encoding are specified. This tool uses a written minus sign, not two’s complement, and does not pad to 8, 16, 32, or 64 bits. It also does not interpret byte order, text encodings, or color channels.