Back MIDI Reference Next

Articles Index

This page describes Hex numbers and how to convert to/from normal numbers.

"Normal" (decimal) numbers

The normally used number system is based at 10.

Last digit in a number represents number of "1"; the second last digit represents the number of "10"; the third last digit represents number of "100" (10 * 10) and so on.

35 = (3 * 10) + (5 * 1)
74 = (7 * 10) + (4 * 1)
234 = (2 * 10 * 10) + (3 * 10) + (4 * 1)

Hex numbers

Hex values are based at the number 16.

Last digit in a hex number represents number of "1"; the second last digit represents the number of "16"; the third last digit represents number of "256" (16 * 16) and so on.

Hex 35 = (3 * 16) + (5 * 1) = 53 (decimal)
Hex 74 = (7 * 16) + (4 * 1) = 116 (decimal)
Hex 234 = (2 * 16 * 16) + (3 * 16) + (4 * 1) = 564 (decimal)

The basic digits (Notice: A = 10; B = 11 etc.):

Hex Decimal
00
11
22
33
44
55
66
77
88
99
A10
B11
C12
D13
E14
F15

Hex values are often written in groups of two characters (from 00 to FF):

Hex 3F A7 = (3 * 16 * 16 * 16) + (15 * 16 * 16) + (10 * 16) + (7 * 1) = 16295

Tip: Use your Windows Calculator in scientific mode to convert to/from Hex numbers.