TABLE OF CONTENTS

Master Conversion Table and Common Bases
Decimal and Binary
Decimal and Octal
Decimal and Hexidecimal
Various Conversion Examples
Who created this web page

MASTER CONVERSION TABLE WITH COMMON BASES

DECIMAL
(base 10)
BINARY
(base 2)
OCTAL
(base 8)
HEXADECIMAL
(base 16)
0 0 0 0
1 1 1 1
2 10 2 2
3 11 3 3
4 100 4 4
5 101 5 5
6 110 6 6
7 111 7 7
8 1000 10 8
9 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
15 1111 17 F
16 10000 20 10
17 10001 21 11
18 10010 22 12
19 10011 23 13
20 10100 24 14
21 10101 25 15
22 10110 26 16
23 10111 27 17
24 11000 30 18
25 11001 31 19
26 11010 32 1A
27 11011 33 1B
28 11100 34 1C
29 11101 35 1D
30 11110 36 1E
31 11111 37 1F
32 100000 40 20
33 100001 41 21

This table shows the different conversions for easy reference. For more in-depth explanations on how the conversions are done, please see below.

However, it is worth noticing that decimal, binary, octal and hex have different bases. The bases tell you how many digits each have to represent the numbers. For example has decimal 10 numbers (from 010 through 910) while octal only has 8 (from 08 through 78).
(The subscript indicates the number's base. In everyday language we assume that the number is given to us is in decimal/base 10. We would be rather surprised if the cashier at the local grocery store gave us the price in octal...)

When decimal has counted up to 910, it has run out of available digits and must increase to two digits, from 910 to 1010, setting the lowest based digit to 0. Also, when counted up to 1910 decimal must use the next available digit after 1 (here 2) in its 10-column, again setting the lowest based digit to 0.

Same principal applies to octal. When octal has counted up to 78 (and hence used the available 8 digits), two digits are needed, going from 78 to 108 and setting the lowest based digit to 0. When octal has counted up to 178, the first digit is flipped to the next available digit (here 2) and the lowest based digit is set to 0.

Where one digit is added to the number, the number is given in bold in the table above.


Back to top
CONVERSION WEB PAGE

MASTER CONVERSION TABLE WITH COMMON BASES


DECIMAL
(base 10)
BINARY
(base 2)
OCTAL
(base 8)
HEXADECIMAL
(base 16)
0 0 0 0
1 1 1 1
2 10 2 2
3 11 3 3
4 100 4 4
5 101 5 5
6 110 6 6
7 111 7 7
8 1000 10 8
9 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
15 1111 17 F
16 10000 20 10
17 10001 21 11
18 10010 22 12
19 10011 23 13
20 10100 24 14
21 10101 25 15
22 10110 26 16
23 10111 27 17
24 11000 30 18
25 11001 31 19
26 11010 32 1A
27 11011 33 1B
28 11100 34 1C
29 11101 35 1D
30 11110 36 1E
31 11111 37 1F
32 100000 40 20
33 100001 41 21

This table shows the different conversions for easy reference. For more in-depth explanations on how the conversions are done, please see below.

However, it is worth noticing that decimal, binary, octal and hex have different bases. The bases tell you how many digits each have to represent the numbers. For example has decimal 10 numbers (from 010 through 910) while octal only has 8 (from 08 through 78).
(The subscript indicates the number's base. In everyday language we assume that the number is given to us is in decimal/base 10. We would be rather surprised if the cashier at the local grocery store gave us the price in octal...)

When decimal has counted up to 910, it has run out of available digits and must increase to two digits, from 910 to 1010, setting the lowest based digit to 0. Also, when counted up to 1910 decimal must use the next available digit after 1 (here 2) in its 10-column, again setting the lowest based digit to 0.
Same principal applies to octal. When octal has counted up to 78 (and hence used the available 8 digits), two digits are needed, going from 78 to 108 and setting the lowest based digit to 0. When octal has counted up to 178, the first digit is flipped to the next available digit (here 2) and the lowest based digit is set to 0.

Where one digit is added to the number, the number is given in bold in the table above.

Back to top

Decimal and Binary Numbers

The Link Between Decimal and Binary Numbers

Decimal numbers are the numbers that people usually use to communicate with in everyday life.  The sequence 1,2,3,4 could be considered a listing of decimal numbers.  Numbers used in decimal numbering are considered to have a base 10.  One reason we find the decimal system easy to communicate with is that people have ten fingers and can easily keep track of figures in a base 10 format.  A sample showing how a number can be expressed in decimal format is presented below:

The decimal number 942 can be broken out as followed to show its base 10 properties:

9x 102  = 900
4 x 101 =   40
2 x 100 =     2
                942
The trick here in base 10 is to remember that each position to the left of a decimal increments the power of 10 by 1.  Similarly, each position to the right of the decimal decrements each power of 10 by 1.  Thus you can see the following pattern to each digit in decimal numbers:

?104 103 102 101 100 (decimal point) 10-0 10-1 10-2 10-3 10-4?
 

Computers do not have 10 fingers (or any fingers for that matter) and can only communicate using the two bits 1 and 0.  As such, they can more easily represent figures using a base 2 format.  Numbers expressed in a base 2 format are called binary numbers.  A sample binary number looks like the following:  10011.  In decimal form, this binary number is equivalent to the number 19.  Conversion will be discussed more thoroughly at the end of this section, but you can begin to see how this conversion may take place by examining the base 2 structure of the number:

1 x 2   =  16
0 x 23    =    0
0 x 22    =    0
1 x 2   =    2
1 x 20    =    1
                19
Binary numbers, similar to decimal numbers can also be expressed via the their base parts, only they use a base 2 instead of base 10.  Thus you will see the following pattern for each of the binary digits in a binary string:

?24 23 22 21 20 (decimal point) 2-0 2-1 2-2 2-3 2-4?
 

Counting in Binary

Remember when we count in decimal that when we run of available digits from 0 to 9, that we ?carry? the 1 to the tens column and reset the ones column to 0?  Well, the same technique can be used in binary counting, except we will be ?carrying? a lot more often as we only have 2 digits to work with!  See the table below for information on counting from 0 to 20 in binary along with relevant notes on the ?carrying process.?
 
 

Decimal Representation Equivalent Binary Representation Notes
0 0 Same as decimal.
1 1 Same as decimal.
2 10 We are out of digits!  Okay, carry the 1 to the tens column and zero out the value in the ones column to make more room.
3 11 Increment the one open 0 to 1.
4 100 We?re out of digits again!  Okay, carry the one 1 to the hundreds column and zero out the remaining ones.
5 101 Increment the first open zero to one.
6 110 Adding 1 to the ones column yields a number that?s too big, so carry the 1 to the open spot in the tens column and zero out the ones column.
7 111 Add 1 to the open position in the ones column.
8 1000 Were out of room! Again!  Okay, carry the one to the next column and zero out the remaining values.
9 1001 Add 1 to the open position in the ones column.
10 1010 Adding 1 to the ones column yields a number that?s too big, so carry the 1 to the open spot in the tens column and zero out the ones column.
11 1011 Add 1 to the open position in the ones column.
12 1100 Adding 1 yields numbers too big for the ones and tens columns so carry the one to the hundreds and zero out the values behind.
13 1101 Add 1 to the open position in the ones column.
14 1110 Adding 1 to the ones column yields a number that?s too big, so carry the 1 to the open spot in the tens column and zero out the ones column.
15 1111 Add 1 to the open position in the ones column.
16 10000 We?re out of room!  Carry the one to the next column and zero out all remaining values.
17 10001 Add one to the open position in the ones column.
18 10010 Adding 1 to the ones column yields a number that?s too big, so carry the 1 to the open spot in the tens column and zero out the ones column.
19 10011 Add 1 to the open position in the ones column.
20 10100 Adding 1 yields numbers too big for the ones and tens columns so carry the one to the hundreds and zero out the values behind.

 

Converting from Decimal to Binary and Binary to Decimal

When a chart is not handy and you don?t want to count all day, you can perform conversions between decimal and binary (and vice versa).  Each method is documented below.

Decimal to Binary Conversion Process

Basically we need to repeatedly divide our decimal number by two (as we are converting to a base 2 format).  The remainders given in this process will yield our binary equivalent number.

For example, to convert the decimal number 19 to binary:
 
 

 Perform calculations in ascending order
 starting with the 19.

                                     1 / 2 = 0 R1
                              2 / 2 = 1 R0
                         4 / 2 = 2 R0
                9 / 2 = 4 R1
        19 / 2  = 9 R1

      Take the remainders in descending order and 10011 yields the binary equivalent to 19 decimal.
 

Binary to Decimal Conversion Process

Our Binary to Decimal conversion process was actually illustrated earlier, but we will explain it here.  Basically, remembering that each digit in the binary sequence can be represented in the following format:

?24 23 22 21 20 (decimal point) 2-0 2-1 2-2 2-3 2-4?

we can then determine the value of each 1 and 0 in the binary string by applying base two raised to the appropriate power.  The appropriate power is determined by the digits location in the string.  Thus if we wish to take the binary number previously obtained above, 10011, it would convert to decimal as follows:

1 x 24   =  16
0 x 23   =    0
0 x 22   =    0
1 x 21   =    2
1 x 20   =    1
                19

 
 
 
 
Back to top

Octal Numbers - Base 8 or Radix 8



Binary
Octal
0
0
1
1
10
2
11
3
100
4
101
5
110
6
111
7
1000
10
1001
11
1010
12
1011
13
1100
14
1101
15
1110
16
1111
17
10000
20
10001
21
10010
22
10011
23
10100
24
10101
25
10110
26
10111
27
11000
30
11001
31
11010
32
11011
33
11100
34
11101
35
11110
36
ETC...
ETC...

Since binary is the way computers "see the world", the above chart shows how Octal lines up with it's binary equivalent.  Aside from binary, To make some sense of the above table, a practical use would be to see how the real world, who uses decimal (or base 10), can be derived from an octal number representaion.

But firse, here are some general mathematical rules and notes:


Here is a conversion from 176 octal (base 8), to a decimal (base 10) representation.
 

    6 X 8 = 6    +
    7 X 8 = 56  +
    1 X 8 = 64  +
                   126 base 10 decimal or 12610

Here is another conversion 78 octal (base 8), to a decimal (base 10) representation.
 

    8 X 8 = 8    +
    7 X 8 = 56  +
                    62 base 10 decimal or 6210

Here is a conversion from decimal 89, to octal.  By using simple division by 8 (octal base 8), we derive the decimal base 10 equivalent from the remainders of the divison.

    1/8  =    0 R 1
    11/8 =   1 R 3
    89/8 = 11 R 2

Therefore, 8910 = 1328

Here is a conversion from decimal 5, to octal.

    5/8 = 0 R 5

Therefore, 510 = 58
What's interesting about this result, is that numbers in Octal from 0 through 7, it will have an equivalent decimal number (base 10).  Becaues Octal is base 8, it begins to devert from the decimal pattern after 7 (i.e., 10, 11,...17, 20, 21, 22,...).

Back to top

Converting from Hexadecimal to Decimal

Converting from Hexadecimal toDecimal

Hexadecimal could be abbreviated as Hex.?Hex? is from the Greek ?hex?, meaning ?six?.?Decimal? is from the Latin ?decem?, meaning ?ten?.Based on those, it is easy to understand that hexadecimal number is a number written in base 16. 

Hexadecimal numbers use 16 characters, including 10 digits and 6 capital letters, written 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A (=10), B (=11), C (=12), D (=13), E (=14), and F (=15).

Hexadecimal number is used to condense the long string of zeros and ones in large binary numbers.This base-16 numeric notation system is frequently used to specify addresses in computer memory.As a sort of programming shorthand, hex makes life simpler for programmers by allowing 8-bit binary values, to be expressed with only 2 hexadecimal digits. For example, binary 1111 equals hex F, binary 0100 equals hex 4, therefore, binary 11110100 equals hexadecimal F4. (See the form for hexadecimal equivalents of binary numbers).

Because we are accustomed to working in decimal, it is often convenient to convert a hexadecimal number to decimal to get a sense of what the number is ?really? worth.For an example, the number AD3B in hexadecimal means:

10 * 163 + 13 * 162 + 3 * 161+ 11 * 160=44347.

How do we get that?

1, the symbol values are: A D 3 B

2, the positional values are:A: 163 = 4096; D: 162 = 256; 3: 161 = 16;B: 160 = 1;

3, the products are: 10 * 163 = 40960

13 * 162= 3328

3 * 161= 48

11 * 160=11

4, the sum is :40960 + 3328 + 48 + 11 = 44347

Another example: 1C8

1, the symbol values are: 1C8

2, the positional values are:1: 162 = 256; C: 161 = 16;8: 160 = 1;

3, the products are: 

1 * 162= 256

12 * 161= 192

8 * 160=8

4, the sum is :256 + 192 + 8 = 456

Now, we consider how to convert decimal numbers to hexadecimal numbers.

For example, decimal 456:

456/16 = 28 remainder 8,

28/16=1 remainder 12,(12 equals C of hexadecimal)

1/16=0 remainder1,

Therefore, (decimal) 456 = 1C8 (hex)

Another example, decimal 44347:

44347/16 = 2771 remainder 11,(11 equals B of hexadecimal)

2771/16=173remainder3,

172/16=10remainder13,(13 equals D of hexadecimal)

10/16=0remainder10,(10 equals A of hexadecimal)

Therefore, (decimal) 44347 = AD3B (hex)

Back to top

Special Converstions

When you want to make conversion between binary to octal, octal to binar, binary to hex or hex to binary, you don't need to worry about division and remainder.You may only need to remember the first few numbers in binary, octal, hex.Then you can do the conversion freely. Here is the way.

            Example 0101 1001 11012    0101 is 5 in hex, 1001 is 9 in hex, 1101 is D in hex, thus the number is
                                59D in hex
            More example

                    Binary                                            Hex

                0101 1100 1010 0001 2                        5CA1
                1111 1101 1010 0101 2                        FDA5

Back to top
Octal Conversion
Octal Numbers - Base 8 or Radix 8

 
Binary
Octal
0
0
1
1
10
2
11
3
100
4
101
5
110
6
111
7
1000
10
1001
11
1010
12
1011
13
1100
14
1101
15
1110
16
1111
17
10000
20
10001
21
10010
22
10011
23
10100
24
10101
25
10110
26
10111
27
11000
30
11001
31
11010
32
11011
33
11100
34
11101
35
11110
36
ETC...
ETC...

Since binary is the way computers "see the world", the above chart shows how Octal lines up with it's binary equivalent.  Aside from binary, To make some sense of the above table, a practical use would be to see how the real world, who uses decimal (or base 10), can be derived from an octal number representaion.

But firse, here are some general mathematical rules and notes:


Here is a conversion from 176 octal (base 8), to a decimal (base 10) representation.
 

    6 X 8 = 6    +
    7 X 8 = 56  +
    1 X 8 = 64  +
                       126 base 10 decimal or 12610

Here is another conversion 78 octal (base 8), to a decimal (base 10) representation.
 

    8 X 8 = 8    +
    7 X 8 = 56  +
                        62 base 10 decimal or 6210

Here is a conversion from decimal 89, to octal.  By using simple division by 8 (octal base 8), we derive the decimal base 10 equivalent from the remainders of the divison.

    1/8  =    0 R 1
    11/8 =   1 R 3
    89/8 = 11 R 2

Therefore, 8910 = 1328

Here is a conversion from decimal 5, to octal.

    5/8 = 0 R 5

Therefore, 510 = 58
What's interesting about this result, is that numbers in Octal from 0 through 7, it will have an equivalent decimal number (base 10).  Becaues Octal is base 8, it begins to devert from the decimal pattern after 7 (i.e., 10, 11,...17, 20, 21, 22,...).
 

Back to top
Converting from Hexadecimal to Decimal

Converting from Hexadecimal to Decimal

 

Hexadecimal could be abbreviated as Hex. “Hex” is from the Greek “hex”, meaning “six”. “Decimal” is from the Latin “decem”, meaning “ten”. Based on those, it is easy to understand that hexadecimal number is a number written in base 16.

Hexadecimal numbers use 16 characters, including 10 digits and 6 capital letters, written 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A (=10), B (=11), C (=12), D (=13), E (=14), and F (=15).

Hexadecimal number is used to condense the long string of zeros and ones in large binary numbers. This base-16 numeric notation system is frequently used to specify addresses in computer memory. As a sort of programming shorthand, hex makes life simpler for programmers by allowing 8-bit binary values, to be expressed with only 2 hexadecimal digits. For example, binary 1111 equals hex F, binary 0100 equals hex 4, therefore, binary 11110100 equals hexadecimal F4. (See the form for hexadecimal equivalents of binary numbers).

Because we are accustomed to working in decimal, it is often convenient to convert a hexadecimal number to decimal to get a sense of what the number is “really” worth. For an example, the number AD3B in hexadecimal means:

 

10 * 163 + 13 * 162 + 3 * 161+ 11 * 160 = 44347.

How do we get that?

1, the symbol values are: A D 3 B

2, the positional values are: A: 163 = 4096; D: 162 = 256; 3: 161 = 16; B: 160 = 1;

3, the products are: 10 * 163 = 40960

13 * 162 = 3328

3 * 161 = 48

11 * 160 = 11

4, the sum is : 40960 + 3328 + 48 + 11 = 44347

 

Another example: 1C8

1, the symbol values are: 1C8

2, the positional values are: 1: 162 = 256; C: 161 = 16; 8: 160 = 1;

3, the products are:

1 * 162 = 256

12 * 161 = 192

8 * 160 = 8

4, the sum is : 256 + 192 + 8 = 456

 

 

 

 

 

 

 

 

Now, we consider how to convert decimal numbers to hexadecimal numbers.

For example, decimal 456:

456/16 = 28 remainder 8,

28/16 = 1 remainder 12, (12 equals C of hexadecimal)

1/16 = 0 remainder 1,

Therefore, (decimal) 456 = 1C8 (hex)

 

Another example, decimal 44347:

 

44347/16 = 2771 remainder 11, (11 equals B of hexadecimal)

2771/16 = 173 remainder 3,

172/16 = 10 remainder 13, (13 equals D of hexadecimal)

10/16 = 0 remainder 10, (10 equals A of hexadecimal)

 

Therefore, (decimal) 44347 = AD3B (hex)

Back to top
numberconv
Special Converstions

When you want to make conversion between binary to octal, octal to binar, binary to hex or hex to binary, you don't need to worry about division and remainder.You may only need to remember the first few numbers in binary, octal, hex.Then you can do the conversion freely. Here is the way.

            Example     0101 1001 11012    0101 is 5 in hex, 1001 is 9 in hex, 1101 is D in hex, thus the number is
                                59D in hex
            More example

                        Binary                                                Hex

                    0101 1100 1010 0001 2                        5CA1
                    1111 1101 1010 0101 2                        FDA5

Back to top

Contributors to this Web Page:

Harry Douglass, Jr.
Tina Deng
Rakel Hansen
David Meyer
Yipeng Wang

Created on October 23, 2000