Advertisement

Hexadecimal converter

Inspect the same unsigned integer in base sixteen, two, eight and ten. Hexadecimal input is selected first for decoding hex values.

Calculator

Decimal integer
42
Binary representation
101010
Octal representation
52
Hexadecimal representation
2A
Minimum unsigned bits
6
Same integer in four bases
BaseRepresentation
Decimal (10)42
Binary (2)101010
Octal (8)52
Hexadecimal (16)2A

Advertisement

How this calculator works

Hexadecimal is a positional system with sixteen symbols. Digits A through F denote decimal 10 through 15. This page centres on reading a hex value and comparing its other representations: a compact base table makes it easier to check a numeric identifier or bit pattern. It treats hex as a plain integer, not a colour, character encoding, byte order or signed machine value. Leading zeros are accepted but omitted from minimum-length results.

Formula

Value = sum(h_i x 16^i), with A=10 through F=15. One hexadecimal digit corresponds to four binary positions.

Worked example

Hex 2A is 2 x 16 + 10 = 42, binary 101010 and octal 52. Binary 10000 is decimal 16, written 10 in hexadecimal.

Advertisement

Frequently asked questions

Are lowercase hex letters accepted?

Yes. Lowercase a through f are accepted and output letters are uppercase.

Does FF mean -1?

As an unsigned integer it means 255. A signed eight-bit interpretation is a separate convention.

Can this decode a colour code?

For colour channels, use HEX to RGB. This page converts the whole hex integer.

Sources

Advertisement