π
H₂O
α

Hexadecimal Calculator

Calculate with hexadecimal numbers and convert between hexadecimal and decimal.

Hexadecimal calculation – Addition, Subtraction, Multiplication or Division

Result

Hexadecimal value:

Decimal value:

Convert Hexadecimal to Decimal

=

Convert Decimal to Hexadecimal

=

The Hexadecimal System

The hexadecimal system (or hex) is a base-16 number system with 16 different symbols: the digits 0 to 9 and the letters A to F. Each hexadecimal digit corresponds to 4 bits (a nibble) in binary, making it particularly well-suited for computing.

Conversion Table

HexadecimalBinaryDecimal
000000
100011
200102
300113
401004
501015
601106
701117
810008
910019
A101010
B101111
C110012
D110113
E111014
F111115

Convert Decimal to Hexadecimal

To convert a decimal number to hexadecimal, divide the number repeatedly by 16 and note the remainders. The remainders read from bottom to top give the hexadecimal number. Example:

255 in Hex:
255 ÷ 16 = 15 R.15 (F)
15 ÷ 16 = 0 R.15 (F)
Result: FF

Convert Hexadecimal to Decimal

Multiply each digit by the correct power of 16 (from the right) and add. E.g.:

1A2 in Decimal:
1×16² + 10×16¹ + 2×16⁰
= 256 + 160 + 2
= 418

Where hex is used

Hex fits computing well: one digit = 4 bits, so binary is easy to read and write. Typical uses:

  • RGB color codes (e.g. #FF0000 for red)
  • Memory addresses
  • Program debugging
  • Unique identifiers (UUID)

Hex in short

Base 16: digits 0–9 then A–F (A=10 … F=15). 0x is often used for addresses, colours and codes.

  • Decimal → Hex: repeated division by 16, read remainders from bottom to top.
  • Hex → Decimal: sum of digits × 16ⁿ according to position.
  • Binary relation: 1 hex digit = 4 bits, so 2 hex digits = 1 byte.

255₁₀ → FF₁₆ (remainders 15=F).

1A2₁₆ → 1×256 + 10×16 + 2×1 = 418.

0x1F → 31 in decimal, 11111 in binary.

Tip: For verification, convert back to decimal and compare. Errors often occur due to incorrect position of powers of 16.

For division-by-16, 0x notation or binary links, the main solver can walk you through it.