Number System Convertion
Number System Convertion
Decimal number is a number expressed in the base 10 numeral system. Decimal number's digits have 10
symbols: 0,1,2,3,4,5,6,7,8,9. Each digit of a decimal number counts a power of 10.
Decimal number example:
65310 = 6×102+5×101+3×100
Binary number is a number expressed in the base 2 numeral system. Binary number's digits have 2 symbols:
zero (0) and one (1). Each digit of a binary number counts a power of 2.
Binary number example:
11012 = 1×23+1×22+0×21+1×20 = 1310
How to convert decimal to binary
Conversion steps:
1. Divide the number by 2.
2. Get the integer quotient for the next iteration.
3. Get the remainder for the binary digit.
4. Repeat the steps until the quotient is equal to 0.
Example #1
Convert 1310 to binary:
Division
Quotient Remainder Bit #
by 2
13/2 6 1 0
6/2 3 0 1
3/2 1 1 2
1/2 0 1 3
So 1310 = 11012
Example #2
Convert 17410 to binary:
Division
Quotient Remainder Bit #
by 2
174/2 87 0 0
87/2 43 1 1
43/2 21 1 2
21/2 10 1 3
10/2 5 0 4
5/2 2 1 5
2/2 1 0 6
1/2 0 1 7
So 17410 = 101011102
Decimal to binary conversion table
0 0 0
1 1 1
2 10 2
3 11 3
4 100 4
5 101 5
6 110 6
7 111 7
8 1000 8
9 1001 9
10 1010 A
11 1011 B
12 1100 C
13 1101 D
14 1110 E
15 1111 F
16 10000 10
Decimal Binary Hex
Number Number Number
17 10001 11
18 10010 12
19 10011 13
20 10100 14
21 10101 15
22 10110 16
23 10111 17
24 11000 18
25 11001 19
26 11010 1A
27 11011 1B
28 11100 1C
29 11101 1D
30 11110 1E
31 11111 1F
32 100000 20
64 1000000 40
128 10000000 80
Decimal to Octal
Octal number is a number expressed in the base 8 numeral system. Octal number's digits have 8 symbols:
0,1,2,3,4,5,6,7. Each digit of an octal number counts a power of 16.
Octal number example:
6278 = 6×82+2×81+7×80 = 158010
How to convert from decimal to octal
Conversion steps:
1. Divide the number by 8.
2. Get the integer quotient for the next iteration.
3. Get the remainder for the octal digit.
4. Repeat the steps until the quotient is equal to 0.
Example #1
Convert 756210 to octal:
7562/8 945 2 2 0
945/8 118 1 1 1
118/8 14 6 6 2
14/8 1 6 6 3
1/8 0 1 1 4
So 756210 = 166128
Example #2
Convert 3563110 to octal:
35631/8 4453 7 7 0
4453/8 556 5 5 1
556/8 69 4 4 2
69/8 8 5 5 3
8/8 1 0 0 4
1/8 0 1 1 5
So 3563110 = 1054578
Decimal to octal conversion table
Decimal Octal
base 10 base 8
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 10
9 11
10 12
11 13
12 14
13 15
14 16
15 17
16 20
17 21
18 22
19 23
20 24
21 25
22 26
23 27
24 30
25 31
26 32
27 33
28 34
29 35
30 36
40 50
50 62
60 74
70 106
80 120
90 132
100 144
200 310
1000 1750
2000 3720
Decimal to Hexadecimal
Hexadecimal number is a number expressed in the base 16 numeral system. Hexadecimal number's digits
have 16 symbols: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F. Each digit of a hexadecimal number counts a power of
16.
Hexadecimal number example:
62C16 = 6×162+2×161+12×160 = 158010
How to convert from decimal to hex
Conversion steps:
1. Divide the number by 16.
2. Get the integer quotient for the next iteration.
3. Get the remainder for the hex digit.
4. Repeat the steps until the quotient is equal to 0.
Example #1
Convert 756210 to hex:
7562/16 472 10 A 0
472/16 29 8 8 1
29/16 1 13 D 2
1/16 0 1 1 3
So 756210 = 1D8A16
Example #2
Convert 3563110 to hex:
35631/16 2226 15 F 0
2226/16 139 2 2 1
139/16 8 11 B 2
8/16 0 8 8 3
So 3563110 = 8B2F16
Decimal to hex conversion table
Decimal Hex
base 10 base 16
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 A
11 B
12 C
13 D
14 E
15 F
16 10
17 11
18 12
19 13
20 14
21 15
22 16
23 17
24 18
25 19
26 1A
27 1B
28 1C
29 1D
30 1E
40 28
50 32
60 3C
70 46
80 50
90 5A
100 64
200 C8
1000 3E8
2000 7D0
Binary to Decimal
How to convert binary to decimal
For binary number with n digits:
dn-1 ... d3 d2 d1 d0
The decimal number is equal to the sum of binary digits (d n) times their power of 2 (2n):
decimal = d0×20 + d1×21 + d2×22 + ...
Example
Find the decimal value of 1110012:
binary number: 1 1 1 0 0 1
power of 2: 25 24 23 22 21 20
0 0 0
1 1 1
Binary Decimal Hex
Number Number Number
10 2 2
11 3 3
100 4 4
101 5 5
110 6 6
111 7 7
1000 8 8
1001 9 9
1010 10 A
1011 11 B
1100 12 C
1101 13 D
1110 14 E
1111 15 F
10000 16 10
10001 17 11
10010 18 12
10011 19 13
10100 20 14
10101 21 15
10110 22 16
10111 23 17
11000 24 18
Binary Decimal Hex
Number Number Number
11001 25 19
11010 26 1A
11011 27 1B
11100 28 1C
11101 29 1D
11110 30 1E
11111 31 1F
100000 32 20
1000000 64 40
10000000 128 80
Octal to Decimal
How to convert from octal to decimal
A regular decimal number is the sum of the digits multiplied with 10 n.
Example #1
137 in base 10 is equal to each digit multiplied with its corresponding 10 n:
13710 = 1×102+3×101+7×100 = 100+30+7
Octal numbers are read the same way, but each digit counts 8 n instead of 10n.
Multiply each digit of the hex number with its corresponding 8 n.
Example #2
37 in base 8 is equal to each digit multiplied with its corresponding 8 n:
378 = 3×81+7×80 = 24+7 = 31
Example #3
7014 in base 8 is equal to each digit multiplied with its corresponding power of 8:
70148 = 7×83+0×82+1×81+4×80= 3584+0+8+4 = 3596
Octal to decimal conversion table
Octal Decimal
base 8 base 10
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
10 8
11 9
12 10
13 11
14 12
15 13
16 14
17 15
20 16
30 24
40 32
50 40
60 48
70 56
100 64
Hex to decimal
How to convert from hex to decimal
A regular decimal number is the sum of the digits multiplied with power of 10.
137 in base 10 is equal to each digit multiplied with its corresponding power of 10:
13710 = 1×102+3×101+7×100 = 100+30+7
Hex numbers are read the same way, but each digit counts power of 16 instead of power of 10.
For hex number with n digits:
dn-1 ... d3 d2 d1 d0
Multiply each digit of the hex number with its corresponding power of 16 and sum:
decimal = dn-1×16n-1 + ... + d3×163 + d2×162 + d1×161+d0×160
Example #1
3B in base 16 is equal to each digit multiplied with its corresponding 16 n:
3B16 = 3×161+11×160 = 48+11 = 5910
Example #2
E7A9 in base 16 is equal to each digit multiplied with its corresponding 16 n:
E7A916 = 14×163+7×162+10×161+9×160 = 57344+1792+160+9 = 5930510
Hex to decimal conversion table
Hex Decimal
Calculation
base 16 base 10
0 0 -
1 1 -
2 2 -
3 3 -
4 4 -
5 5 -
6 6 -
7 7 -
8 8 -
9 9 -
A 10 -
B 11 -
C 12 -
D 13 -
E 14 -
F 15 -
10 16 1×161+0×160 = 16
11 17 1×161+1×160 = 17
12 18 1×161+2×160 = 18
13 19 1×161+3×160 = 19
14 20 1×161+4×160 = 20
15 21 1×161+5×160 = 21
16 22 1×161+6×160 = 22
17 23 1×161+7×160 = 23
18 24 1×161+8×160 = 24
19 25 1×161+9×160 = 25
1A 26 1×161+10×160 = 26
1B 27 1×161+11×160 = 27
1C 28 1×161+12×160 = 28
1D 29 1×161+13×160 = 29
1E 30 1×161+14×160 = 30
1F 31 1×161+15×160 = 31
20 32 2×161+0×160 = 32
30 48 3×161+0×160 = 48
40 64 4×161+0×160 = 64
50 80 5×161+0×160 = 80
60 96 6×161+0×160 = 96
70 112 7×161+0×160 = 112