MODERN · BASE 16

Hexadecimal

Hex

Digits 0–9 and letters A–F count powers of sixteen. Decimal 42 becomes 2A in hexadecimal.

Convert numbers
Place
Worldwide · digital computing
Period / variant
Modern computing
EXAMPLES

42 · Base 16

2A: 2 × 16 + 10 = 42.

Worked example

Write 42 in Hexadecimal

Read from left to right. The rightmost place counts ones; each place to its left is worth 16 times as much.

  1. 42 ÷ 16 = 2, remainder 10. Start with 2 in the 16s place, then write the remainder in the lower places.

  2. This sign is the digit 2. In the 16s place, it contributes 2 × 16 = 32.

  3. The letter A is the digit 10. At the ones place, it contributes 10.

Check

2 × 16 + 10 = 42

Sources and notation notes

NASA Space Place — Why is sixteen so sweet? · NASA Space Place — How do we talk to machines?

Meet the symbols

Each tile shows one digit and its value. These are the 16 digits used by this display. Combine them using the rules below.

  • 0
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15

How the symbols fit together

Read from left to right. A, B, C, D, E, and F stand for 10, 11, 12, 13, 14, and 15. From the right, positions are worth 1, 16, 256, 4,096, and higher powers of sixteen.

  1. Learn the sixteen digits: 0–9, then A = 10, B = 11, C = 12, D = 13, E = 14, and F = 15.
  2. For 2A, the left digit 2 is in the sixteens position: 2 × 16 = 32.
  3. The right digit A is worth ten ones. Add 32 + 10 = 42.
  4. Each hexadecimal digit also matches four binary bits: 2A is 0010 1010 in binary. A zero holds an empty place; 100 in hexadecimal is decimal 256.

15 in Hexadecimal

F is the single digit for fifteen.

16 in Hexadecimal

10: one sixteen and zero ones.

42 in Hexadecimal

2A: 2 × 16 + 10 = 42.

255 in Hexadecimal

FF: 15 × 16 + 15 = 255.

256 in Hexadecimal

100: one 256, zero sixteens, and zero ones.

39321 in Hexadecimal

NASA’s example: 9999 in hexadecimal equals decimal 39,321.

Enter a nonnegative whole number in decimal, using at most 100 decimal digits. Output uses uppercase A–F and omits the optional 0x prefix and leading zeros. Signed, fractional, and fixed-width machine encodings are outside this converter.

History

Hexadecimal makes binary data compact enough to read easily: one hexadecimal digit represents four bits. Modern computing uses the digits 0–9 followed by A–F for the values ten through fifteen. The notation is used internationally to display computer data.

How to read it

Read from left to right. A, B, C, D, E, and F stand for 10, 11, 12, 13, 14, and 15. From the right, positions are worth 1, 16, 256, 4,096, and higher powers of sixteen.

  1. Learn the sixteen digits: 0–9, then A = 10, B = 11, C = 12, D = 13, E = 14, and F = 15.
  2. For 2A, the left digit 2 is in the sixteens position: 2 × 16 = 32.
  3. The right digit A is worth ten ones. Add 32 + 10 = 42.
  4. Each hexadecimal digit also matches four binary bits: 2A is 0010 1010 in binary. A zero holds an empty place; 100 in hexadecimal is decimal 256.

Limits

Enter a nonnegative whole number in decimal, using at most 100 decimal digits. Output uses uppercase A–F and omits the optional 0x prefix and leading zeros. Signed, fractional, and fixed-width machine encodings are outside this converter.

Compare systems