PDF download Download Article PDF download Download Article

The decimal (base ten) numeral system has ten possible values (0,1,2,3,4,5,6,7,8, or 9) for each place-value. In contrast, the binary (base two) numeral system has two possible values represented as 0 or 1 for each place-value.[1] Since the binary system is the internal language of electronic computers, serious computer programmers should understand how to convert from decimal to binary.

Converting Decimal to Binary

Divide the decimal number by 2, and write down the remainder (either 0 or 1). Divide the quotient by 2, and continue down the remainder. Keep dividing until the quotient equals 0, and write the remainders in reverse order to find the binary number.

Method 1
Method 1 of 2:

Performing Short Division by Two with Remainder

PDF download Download Article
  1. Set up the problem. For this example, let's convert the decimal number 15610 to binary. Write the decimal number as the dividend inside an upside-down "long division" symbol. Write the base of the destination system (in our case, "2" for binary) as the divisor outside the curve of the division symbol.[2]
    • This method is much easier to understand when visualized on paper, and is much easier for beginners, as it relies only on division by two.
    • To avoid confusion before and after conversion, write the number of the base system that you are working with as a subscript of each number. In this case, the decimal number will have a subscript of 10 and the binary equivalent will have a subscript of 2.
  2. Write the integer answer (quotient) under the long division symbol, and write the remainder (0 or 1) to the right of the dividend.[3]
    • Since we are dividing by 2, when the dividend is even the binary remainder will be 0, and when the dividend is odd the binary remainder will be 1.
    Advertisement
  3. Continue downwards, dividing each new quotient by two and writing the remainders to the right of each dividend. Stop when the quotient is 0.[4]
  4. Starting with the bottom remainder, read the sequence of remainders upwards to the top. For this example, you should have 10011100. This is the binary equivalent of the decimal number 156. Or, written with base subscripts: 15610 = 100111002[5]
    • This method can be modified to convert from decimal to any base. The divisor is 2 because the desired destination is base 2 (binary). If the desired destination is a different base, replace the 2 in the method with the desired base. For example, if the desired destination is base 9, replace the 2 with 9. The final result will then be in the desired base.
  5. Advertisement
Method 2
Method 2 of 2:

Descending Powers of Two and Subtraction

PDF download Download Article
  1. List the powers of two in a "base 2 table" from right to left. Start at 20, evaluating it as "1". Increment the exponent by one for each power. Make the list up until you've reached a number very near the decimal system number you're starting with. For this example, let's convert the decimal number 15610 to binary.[6]
  2. Choose the biggest number that will fit into the number you are converting. 128 is the greatest power of two that will fit into 156, so write a 1 beneath this box in your chart for the leftmost binary digit. Then, subtract 128 from your initial number. You now have 28.[7]
  3. Using your new number (28), move down the chart marking how many times each power of 2 can fit into your dividend. 64 does not go into 28, so write a 0 beneath that box for the next binary digit to the right. Continue until you reach a number that can go into 28.[8]
  4. 16 can fit into 28, so you will write a 1 beneath its box and subtract 16 from 28. You now have 12. 8 does go into 12, so write a 1 beneath 8's box and subtract it from 12. You now have 4.[9]
  5. Remember to mark a 1 beneath each number that does go into your new number, and a 0 beneath those that don't.[10]
  6. The number will be exactly the same from left to right as the 1's and 0's beneath your chart. You should have 10011100. This is the binary equivalent of the decimal number 156. Or, written with base subscripts: 15610 = 100111002.[11]
    • Repetition of this method will result in memorization of the powers of two, which will allow you to skip Step 1.
  7. Advertisement

Community Q&A

Search
Add New Question
  • Question
    How do you convert the fractional part of a decimal to a binary?
    Community Answer
    Community Answer
    If the decimal number has a fractional part, then the fractional parts are converted into binary by multiplying it by 2. Only the integer part of the result is noted. Repeat the multiplication until the fractional part becomes 0 or until the sequence repeats itself. E.g. 0.375 is the number we want to convert, so we'll start multiplying it by 2. 0.375*2=0.75. Here, the integer part is 0, note it down, and the fractional part is not 0, so we repeat this until the fractional part becomes 0 or the sequence repeats itself. Next, 0.75*2=1.50, note down 1, subtract 1 to get 0.50. 0.50*2=1.00. We stop here because the fractional part is 0, and make note of the 1. Then take the integer parts we noted: 0,1,1, and place them after the decimal point to get .011. Therefore, 0.011 is the binary form of 0.375
  • Question
    How do I convert a mixed number to binary?
    Donagan
    Donagan
    Top Answerer
    Convert the mixed number to a decimal, then follow the instructions in the article above.
  • Question
    How do I convert 0.2663 into binary?
    Jordan Newberry
    Jordan Newberry
    Community Answer
    Start by converting 0.2663 into the fraction 2,663 / 10,000 . Use the steps above to convert 2,663 into the binary number 1010 0110 0111 and 10,000 into 10 0111 0001 0000 . So, now we have a binary fraction: 1010 0110 0111 / 10 0111 0001 0000 . Divide 1010 0110 0111 by 10 0111 0001 0000 . To do this, follow the WikiHow article: "How to Divide Binary Numbers". When you divide 1010 0110 0111 by 10 0111 0001 0000 you should get 0.0100 0100 0010... I rounded to the nearest 4,096 th.
See more answers
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement

Video

Tips

  • Practice. Try converting the decimal numbers 17810, 6310, and 810. The binary equivalents are 101100102, 1111112, and 10002. Try converting 20910, 2510, and 24110 to, respectively, 110100012, 110012, and 111100012.
  • The calculator that comes installed with Windows 10 can do this conversion for you, but as a programmer, you're better off with a good understanding of how the conversion works. The calculator's conversion options can be made visible by opening its "View" menu and selecting "Programmer"
  • Converting in the opposite direction, from binary to decimal, is often easier to learn first.
Submit a Tip
All tip submissions are carefully reviewed before being published
Name
Please provide your name and last initial
Thanks for submitting a tip for review!
Advertisement

You Might Also Like

Convert from Binary to DecimalConverting Binary to Decimal: Positional Notation & Doubling
Convert from Decimal to HexadecimalConvert from Decimal to Hexadecimal: A Quick Guide + Examples
Decode Binary NumbersDecode Binary Numbers
Convert Binary to Octal NumberConvert Binary to Octal Number
Convert Celsius (°C) to Fahrenheit (°F)°C to °F Conversion: A Complete Guide
Calculate Volume in LitresCalculate Volume in Litres
Convert a Number from Decimal to IEEE 754 Floating Point RepresentationConvert a Number from Decimal to IEEE 754 Floating Point Representation
Convert Milliliters (mL) to Grams (g)Convert Milliliters (mL) to Grams (g)
Convert Minutes to HoursConverting Minutes to Hours in Decimal or Hour & Minute Format
Convert Grams to KilogramsConversion Factor for Grams to Kilograms (and Kilograms to Grams)
Convert Pounds to KilogramsConvert Pounds to Kilograms with These Easy Tricks
Convert Kilometers to MilesConvert Kilometers to Miles
Convert Hexadecimal to Binary or DecimalConvert Hexadecimal to Binary or Decimal
Convert Centimeters to InchesConvert Centimeters to Inches
Advertisement

About This Article

Grace Imson, MA
Reviewed by:
Math Teacher
This article was reviewed by Grace Imson, MA. Grace Imson is a math teacher with over 40 years of teaching experience. Grace is currently a math instructor at the City College of San Francisco and was previously in the Math Department at Saint Louis University. She has taught math at the elementary, middle, high school, and college levels. She has an MA in Education, specializing in Administration and Supervision from Saint Louis University. This article has been viewed 5,157,091 times.
245 votes - 75%
Co-authors: 128
Updated: April 21, 2024
Views: 5,157,091
Article SummaryX

To convert a number from decimal to binary, write down the number at the top of a sheet of paper. Divide the number by 2, and write the remainder out to the side. If you are dividing an odd number, the remainder will be 1, and if it’s even, the remainder will be 0. After you divide the number, write the result on the next line, divide it by 2, and write down the remainder. Continue this until the quotient is 0. Starting at the bottom, write down all the remainders in order. This new number is the binary conversion of the decimal. If you want to learn how to find the binary of a decimal using subtraction and the powers of 2, keep reading the article!

Did this summary help you?

Thanks to all authors for creating a page that has been read 5,157,091 times.

Reader Success Stories

  • Aaron B.

    Aaron B.

    May 5, 2018

    "At first I had no clue what the heck were these 1's and 0's, but after reading a few articles like this..." more
Share your story

Did this article help you?

Advertisement