How to Convert Decimal to Binary and Binary to Decimal

Updated on June 24, 2020
eugbug profile image

Eugene is a qualified control/instrumentation engineer Bsc (Eng) and has worked as a developer of electronics & software for SCADA systems.

Base 2, the Basis for Binary Code

The base 2, or binary numbering system is the basis for all binary code and data storage in computing systems and electronic devices. This guide shows you how to convert from binary to decimal and decimal to binary.

Binary number and its decimal equivalent.
Binary number and its decimal equivalent. | Source

Decimal, the Base 10 Numbering System

First let's start with decimal.

The decimal, also known as the denary or base 10 numbering system is what we use in everyday life for counting. The fact that there are ten symbols is more than likely because we have 10 fingers.

We use ten different symbols or numerals to represent the numbers from zero to nine.

Those numerals are 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9

When we get to the number ten, we have no numeral to represent this value, so it is written as:


The idea is to use a new place holder for each power of 10 to make up any number we want.

So 134 means one hundred, 3 tens and a 4 although we just interpret and read it as the number one hundred and thirty four.

Placeholder Value in the Decimal Numbering System

Placeholder value in the base 10 number system
Placeholder value in the base 10 number system | Source

Binary, the Base 2 Numbering System

In the decimal number system, we saw that ten numerals were used to represent numbers from zero to nine.

Binary only uses two numerals 0 and 1. Place holders in binary each have a value of powers of 2. So the first place has a value 20 = 1, the second place 21 = 2, the third place 22 = 4, the fourth place 23 = 8 and so on.

In binary we count 0, 1 and then since there's no numeral for two we move onto the next place holder so two is written as 10 binary. This is exactly the same as when we get to ten decimal and have to write it as 10 because there's no numeral for ten.

Placeholder Value in the Binary Numbering System

Placeholder value in the binary number system
Placeholder value in the binary number system | Source

Most Significant Bit (MSB) and Least Significant Bit (LSB)

For a binary number, the most significant bit (MSB) is the digit furthermost to the left of the number and the least significant bit (LSB) is the rightmost digit.

Most significant bit (MSB) and least significant bit (LSB).
Most significant bit (MSB) and least significant bit (LSB). | Source

Decimal and Binary Equivalents


Steps to Convert from Decimal to Binary

If you don't have a calculator to hand, you can easily convert a decimal number to binary using the remainder method. This involves dividing the number by 2 recursively until you're left with 0, while taking note of each remainder.

  1. Write down the decimal number.
  2. Divide the number by 2.
  3. Write the result underneath.
  4. Write the remainder on the right hand side. This will be 0 or 1.
  5. Divide the result of the division by 2 and again write down the remainder.
  6. Continue dividing and writing down remainders until the result of the division is 0.
  7. The most significant bit (MSB) is at the bottom of the column of remainders and the least significant bit (LSB) is at the top.
  8. Read the series of 1s and 0s on the right from the bottom up. This is the binary equivalent of the decimal number.

Converting decimal to binary
Converting decimal to binary | Source

Steps to Convert Binary to Decimal

Converting from binary to decimal involves multiplying the value of each digit (i.e. 1 or 0) by the value of the placeholder in the number

  1. Write down the number.
  2. Starting with the LSB, multiply the digit by the value of the place holder.
  3. Continue doing this until you reach the MSB.
  4. Add the results together.

Converting binary to decimal
Converting binary to decimal | Source

Test Yourself!

view quiz statistics

Indicating the Base of a Number

The binary number 1011011 can be written as 10110112 to explicitly indicate the base. Similarly 54 base 10 can be written 5410 Often however, the subscript is omitted to avoid excessive detail when the context is known. Usually subscripts are only included in explanatory text or notes in code to avoid confusion if several numbers with different bases are used together.

What is Binary Used For?

For more details on how binary is used in computer systems and digital electronics, see my other article:

Why is Binary Used In Computers and Electronics?

What Other Bases Are There Apart From 2 and 10?

Base 16 or hexadecimal (hex for short) is a shorthand used when programming computer systems. It uses sixteen symbols, representing 10, 11, 12, 13, 14 and 15 decimal with the letters A, B, C, D, E, and F respectively. You can read more about converting hex to binary and binary to hex here:

How to Convert Hex to Binary and Binary to Hexadecimal

Questions & Answers

© 2018 Eugene Brennan


    0 of 8192 characters used
    Post Comment
    • profile image

      Gehna Kalra 

      11 hours ago

      Wow! Great sir!! Its just fabulous Explanation........

    • asujatha profile image


      5 weeks ago from Noida

      That is one useful article !!!!

    • profile image


      5 weeks ago

      Thank you very much this is very helpful for me.

    • profile image

      sama makled 

      2 months ago

      thank you

    • profile image


      2 months ago

      thank you

    • profile image


      3 months ago

      Superb explanation. Thank you

    • profile image


      4 months ago


    • profile image

      Ananyya Nair 

      4 months ago

      This really helped a lot thanks.

    • eugbug profile imageAUTHOR

      Eugene Brennan 

      5 months ago from Ireland

      Hi Jerome,

      The link in "Questions & Answers" above is to a tutorial which shows you how to do this.

    • profile image


      5 months ago

      How do you convert a decimal number 'n' where 1 is greater than 'n' and 'n' is greater than 0?

      In otherwords, how to convert a positive fractional amount to binary?

      I.E., 0.1 = x where 'x' is base 2

    • profile image


      7 months ago

      Thanks man

    • profile image


      7 months ago

      Good tool

    • profile image

      Asif shah 

      7 months ago

      Nice sir, its very helpfull....

    • profile image

      Shaik Ahmed Ali, MA LLM 

      7 months ago

      Nicely explained sir....Thank you

    • profile image

      Jumat busayo 

      8 months ago

      We done

      thanks so much sir for the article

    • profile image

      Jairos Mugandani 

      9 months ago

      Well done Eugene

      You made it so simple,I enjoyed going through the article

    • eugbug profile imageAUTHOR

      Eugene Brennan 

      9 months ago from Ireland

      Hi Racheal, Have a look at the link in the Q&A that shows you how to do this.

    • profile image


      9 months ago

      Please convert 26.24 to base2

    • profile image

      Patrissia Cuberos 

      9 months ago

      Thank you for demystifying maths for those of us without the basic knowledge!

    • profile image


      10 months ago

      Thank you so much sir....I found your explanation to be very useful God bless you sir!!!!

    • profile image

      francis khayeka 

      12 months ago

      thanks alot be blessed excellent explanations

    • eugbug profile imageAUTHOR

      Eugene Brennan 

      13 months ago from Ireland

      Yes, you're right!

      Thanks for spotting the silly error.

    • profile image


      13 months ago

      I believe this is not correct:

      "so three is written as 10 binary. This is exactly the same as when we get to ten decimal and have to write it as 10 because there's no numeral for ten."

      Decimal 3 is binary 11.

      Binary 10 is decimal 2.

    • profile image

      kwizera mugara gentil 

      14 months ago

      thank you for good lectures may good Lord God bless you

    • profile image


      15 months ago

      Very good explanation. Thank you very much sir.Can understand easily.

    • profile image

      shahzar khan 

      15 months ago

      This information was very useful to me.

      i was looking how to convert (binary to decimal) and (decimal to binary) and this was in very good pattern to understand it.

    • profile image

      RajaSri S 

      15 months ago

      Good explanation, thanks

    • profile image

      zamani ezekiel 

      16 months ago

      Am a 200level student in the university of jos,plateau state

      here in Nigeria. I found your site very help ful to me.

      Am a computer science student.I just want to say thank you you are really doing a great job.can u help me in any way u can so as i put my best in my study. thank you sir.

    • eugbug profile imageAUTHOR

      Eugene Brennan 

      21 months ago from Ireland

      Thanks Tim. I'm a veteran from the DOS age too!

    • Tim Truzy info4u profile image

      Tim Truzy 

      21 months ago from U.S.A.

      Excellent article. I really liked the technique you presented here. As I read this article, I had fond memories of writing programs in DOS and my teacher going through the binary system with us. Negative or positive? Off or on?

      Thanks a lot for a well written and informative article.



    • eugbug profile imageAUTHOR

      Eugene Brennan 

      21 months ago from Ireland

      Thanks Ron, always good to get feedback from you! Now hopefully this short guide will become as popular as the hex to binary one! (BTW, I just had to Google "Mechanicsburg". I'm always curious about the history of how places got their names!)

    • RonElFran profile image

      Ronald E Franklin 

      21 months ago from Mechanicsburg, PA

      It's interesting to me that as a (now retired) engineer who spent years designing logic for chips, your decimal to binary method didn't bring back any fond memories. As I think of it, although I had to convert from binary to decimal all the time, I don't recall having to go the other way very often. That's probably not the case for every logic designer. In my case I think it's because I wasn't really dealing with numbers per se, but usually with enacting state machines. In any case, good article.


    This website uses cookies

    As a user in the EEA, your approval is needed on a few things. To provide a better website experience, uses cookies (and other similar technologies) and may collect, process, and share personal data. Please choose which areas of our service you consent to our doing so.

    For more information on managing or withdrawing consents and how we handle data, visit our Privacy Policy at:

    Show Details
    HubPages Device IDThis is used to identify particular browsers or devices when the access the service, and is used for security reasons.
    LoginThis is necessary to sign in to the HubPages Service.
    Google RecaptchaThis is used to prevent bots and spam. (Privacy Policy)
    AkismetThis is used to detect comment spam. (Privacy Policy)
    HubPages Google AnalyticsThis is used to provide data on traffic to our website, all personally identifyable data is anonymized. (Privacy Policy)
    HubPages Traffic PixelThis is used to collect data on traffic to articles and other pages on our site. Unless you are signed in to a HubPages account, all personally identifiable information is anonymized.
    Amazon Web ServicesThis is a cloud services platform that we used to host our service. (Privacy Policy)
    CloudflareThis is a cloud CDN service that we use to efficiently deliver files required for our service to operate such as javascript, cascading style sheets, images, and videos. (Privacy Policy)
    Google Hosted LibrariesJavascript software libraries such as jQuery are loaded at endpoints on the or domains, for performance and efficiency reasons. (Privacy Policy)
    Google Custom SearchThis is feature allows you to search the site. (Privacy Policy)
    Google MapsSome articles have Google Maps embedded in them. (Privacy Policy)
    Google ChartsThis is used to display charts and graphs on articles and the author center. (Privacy Policy)
    Google AdSense Host APIThis service allows you to sign up for or associate a Google AdSense account with HubPages, so that you can earn money from ads on your articles. No data is shared unless you engage with this feature. (Privacy Policy)
    Google YouTubeSome articles have YouTube videos embedded in them. (Privacy Policy)
    VimeoSome articles have Vimeo videos embedded in them. (Privacy Policy)
    PaypalThis is used for a registered author who enrolls in the HubPages Earnings program and requests to be paid via PayPal. No data is shared with Paypal unless you engage with this feature. (Privacy Policy)
    Facebook LoginYou can use this to streamline signing up for, or signing in to your Hubpages account. No data is shared with Facebook unless you engage with this feature. (Privacy Policy)
    MavenThis supports the Maven widget and search functionality. (Privacy Policy)
    Google AdSenseThis is an ad network. (Privacy Policy)
    Google DoubleClickGoogle provides ad serving technology and runs an ad network. (Privacy Policy)
    Index ExchangeThis is an ad network. (Privacy Policy)
    SovrnThis is an ad network. (Privacy Policy)
    Facebook AdsThis is an ad network. (Privacy Policy)
    Amazon Unified Ad MarketplaceThis is an ad network. (Privacy Policy)
    AppNexusThis is an ad network. (Privacy Policy)
    OpenxThis is an ad network. (Privacy Policy)
    Rubicon ProjectThis is an ad network. (Privacy Policy)
    TripleLiftThis is an ad network. (Privacy Policy)
    Say MediaWe partner with Say Media to deliver ad campaigns on our sites. (Privacy Policy)
    Remarketing PixelsWe may use remarketing pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to advertise the HubPages Service to people that have visited our sites.
    Conversion Tracking PixelsWe may use conversion tracking pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to identify when an advertisement has successfully resulted in the desired action, such as signing up for the HubPages Service or publishing an article on the HubPages Service.
    Author Google AnalyticsThis is used to provide traffic data and reports to the authors of articles on the HubPages Service. (Privacy Policy)
    ComscoreComScore is a media measurement and analytics company providing marketing data and analytics to enterprises, media and advertising agencies, and publishers. Non-consent will result in ComScore only processing obfuscated personal data. (Privacy Policy)
    Amazon Tracking PixelSome articles display amazon products as part of the Amazon Affiliate program, this pixel provides traffic statistics for those products (Privacy Policy)
    ClickscoThis is a data management platform studying reader behavior (Privacy Policy)