⌚ September 4, 2014
 100
 100
 100
how do we know which is decimal, which is binary, and which is hexadecimal? All three numbers look alike because they use the same digits, 0 and 1, but all three represent different values in different number systems. Surely, there must be a way to avoid ambiguity, right?
Indeed there is.
Identifying Binary and Decimal Numbers
Binary 100 and decimal 100 do not express the same value because 100 in binary converts to the decimal value 4 and 100 in decimal is simply one hundred.
There is no way to differentiate between 100 (base 2) and 100 (base 10) by themselves outside of context. To avoid ambiguity, there are three ways to specify the base when combining number systems.
1. Specify the base in parentheses: 100 (base 2) or 100 (base 10) or 100 (hex)
2. Append a lowercase b for binary, d for decimal, or h for hexadecimal after the number.
100b (binary) 100d (one hundred in decimal) 100h (256d in hex)
3. Use subscript notation denoting the base after the number.
 100_{2} = Base 2, binary
 100_{10} = Base 10, decimal
 100_{16} = Base 16, hexadecimal
Notes
Hexadecimal. Hexadecimal has an extra notation: 0x. The following are four different ways to denote hexadecimal:

0xff

ffh

ff_{16}

ff (base 16)
No Base Assumes Decimal. If no base is specified, we can usually assume decimal unless noted as another number system from context. For example, 100 by itself would mean 100d, not 100b unless the text is specifically referring to binary. However, even if the text is talking about binary, it is common practice to denote binary 100 as 100b anyway to avoid confusion.
1123 = 1,123 (one thousand, one hundred twentythree in decimal).
This contains nonbinary digits, so we know that this is not a binary number. However, we have no way of knowing which base this represents since there are other number systems that use these digits. It could be base 5, base 8, base 16, or something else as long as it is base 4 or greater.
(1,123 contains the digit 3, which is the highest digit of base 4. We know that 1,123 must be a value written in base 4 or greater since base 3 and lower do not contain the digit 3.)
Because base 10 is the most common number system, we can assume base 10 unless noted.
Examples
 11000b = 24d
 11000d = 11,000d (eleven thousand in decimal)
 0110d = onehundred, ten in decimal (an unusual format designed for trickery that is better written as 110d)
 1100h = 4,352d (four thousand, threehundred, fiftytwo in decimal)
 1100_{2} = 1100b
 1,234_{10} = 1,234d
 1100_{16} = 1100h
 1,100 (base 10) = 1,100d = 1,100_{10}
 100 (base 16) = 100h
 100 (base 2) = 100b = 4d
 0xFF = FFh = ffh = 0xff = 255d = 11111111b
Convert 10100001b to decimal
128 64 32 16 8 4 2 1 1 0 1 0 0 0 0 1
128 + 32 + 1 = 161 decimal
Convert 00011100 (base 2) to decimal
128 64 32 16 8 4 2 1 0 0 0 1 1 1 0 0
16 + 8 + 4 = 28
Convert 10100110_{2} to decimal
128 + 32 + 4 + 2 = 166 decimal
If the place values are memorized, we can perform lowbit conversions mentally.
In the three examples above, the binary base was notated differently.
Practice
Specify the number system of each value.

100d

1

oxfe2222ef

23 (base 2)

16_{16}

666h

1000_{10}

100,000_{2}

10011001 11111100_{2}

10011001_{2} 11111100_{2}

10011001_{10} 11111100_{2}
Answers
 Decimal.
 Decimal. No base was specified, so we assume decimal even though these are binary lessons.
 Hexadecimal.
 Oops! A trick question! This is invalid because we cannot use the digits 2 and 3 in base 2.
 Hexadecimal. Converts to 22d and 10110b.
 Hexadecimal. A common graycolor shorthand for 0x666666 that is used in cascading style sheets (CSS).
 1,000 in decimal.
 Binary, but not quite correct. We do not use commas to separate groups in binary. Instead, we break up long binary strings of digits into groups of four or eight for readability. 100,000_{2} should be written as 100000_{2}.
 Binary. We see two groups of eight for readability, but it is one binary number despite the space between them. This is not common due to possible ambiguity. Are these two separate numbers with the first being a decimal 10,011,001 and the second a binary 11111100? To avoid confusion, this would be better written as one long string of digits despite the resulting bulkiness: 1001100111111100_{2}.
 Binary. However, these are definitely two separate numbers, not one, single number. Each has a specified base, so we know that two different numbers, 10011001_{2} and 11111100_{2} are intended. If we wish to denote a single 16bit value, it is best to write 1001100111111100_{2}. This avoids any possible confusion. For extremely long binary numbers, such as 32bit, 64bit, and 128bit values, hexadecimal is preferred.
 Decimal first, Binary second. These are two separate numbers listed one after another. The first number, 10011001_{10}, is decimal, and it should have been written with commas as 10,011,001_{10} in order to avoid being mistaken as a binary number since the subscript is in smaller print. The second number is binary, and it is written correctly.