How to Convert Binary Into Decimal (and Vice Versa) (2024)

How to Convert Binary Into Decimal (and Vice Versa) (1)

Humans spent the last five and a half millennia inventing over 100 different ways to write down numbers. With due respect to Roman numerals, the world's favorite technique right now is — by a huge margin — the modern decimal system. Its users can express any whole number they like with just 10 little characters: 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9.

However, your computer takes another approach. Laptops, smartphones, and other devices rely on binary code. A mathematical language, binary relays instructions to these high-tech gizmos. It tells your computer how a podcaster's voice sounds, which colors should appear in a YouTube video, and how many letters were used in that email your boss just sent.

Advertisem*nt

Binary code lives up to its name. Unlike the decimal number system, it uses only two digits, which programmers call "bits." Usually, there's "0" and there's "1." And that's all. Luckily, we'll show you how to convert a binary number into the more familiar decimal system. Then, like a good magician, we'll do the exact opposite, bringing the decimal to binary value.

Contents

  1. Know Your Exponents
  2. Understanding the Binary Number System
  3. Converting Binary Numbers to Decimal Value
  4. Determining the Decimal Equivalent
  5. Decimal Conversion Formula
  6. Interpreting the Decimal Value

Know Your Exponents

Understanding positional notation is key for dealing with both the number systems and the conversions. Every digit plays its part in the calculation, from the most significant bit to the least significant bit. Technically, 0 and 1 are the only bits you need to write binary numbers. But to make sense of them, you have to understand a third value: 2.

It's best if we explain this by way of example. The number 138 is properly expressed in binary code as "10001010." How can your computer tell this apparent string of gibberish means "138"? Programming is part of the answer. Somebody has informed your device that — in this case — the binary code spells out a number instead of a written word or sentence; there's a separate method for decoding the latter.

Advertisem*nt

Once this basic fact is established, the code works by assigning a different exponent of 2 to each individual bit (i.e., every 0 and every 1). An exponent is a value multiplied by itself a certain number of times. So, 2 to the third power, written as 23, is 2 x 2 x 2, which equals 8.

Please enjoy the following powers of 2 list. Trust us, you'll want to look this over soon.

2 = 1

21 = 2

22 = 4

23 = 8

24 = 16

25 = 32

26 = 64

27 = 128

28 = 256

29 = 512

210 = 1024

Advertisem*nt

Understanding the Binary Number System

Now let's go back to our original binary number: 10001010. If English is your native language, brace yourself, as you're about to fight against your instincts. See, written English is read from left to right. But now, we have to break down that binary number by going in the opposite direction: from right to left.

In any binary number, the bit that's farthest to the right has to be multiplied by 2. Then the one to its immediate left is multiplied by 21. Next, the bit to its left is multiplied by 22. And so on and so forth. Notice a pattern here? The individual exponents of 2 are being used in ascending order, from right to left.

Advertisem*nt

OK, so now our job is to keep that pattern going until we've matched an exponent of 2 to every bit — every single 0 and 1— in the binary number. We'll stop once the final bit, the one on the far left side, has been multiplied by the appropriate exponent of 2.

A helpful way to keep your figures straight is to physically line up the exponents over their corresponding binary bits on a sheet of paper. Ideally, it should look something like this:

How to Convert Binary Into Decimal (and Vice Versa) (2)

Advertisem*nt

Converting Binary Numbers to Decimal Value

Good stuff. Alright, now let's return to the actual binary to decimal conversion. Because 10001010 contains 8 individual bits, we're going to do 8 separate multiplication problems. Let's begin with the 0 on the far right end. What's 0 x 2? The correct answer is 0.

One problem down, seven to go. Move one space to the left. See the "1" there? Well, 1 x 21 = 2. Now move yet another space to the left. Doing so will give you 0 x 22, which equals 0. If you continue using this pattern, proceeding from the rightmost digit to the leftmost digit, here's what you'll ascertain:

Advertisem*nt

0 x 2 = 0

1 x 21 = 2

0 x 22 = 0

1 x 23 = 8

0 x 24 = 0

0 x 25 = 0

0 x 26 = 0

1 x 27 = 128

Advertisem*nt

Determining the Decimal Equivalent

Hang on, we're almost at the finish line! Take the results of all those multiplication problems and add them together. Not multiply, add. Savvy? What does 0 + 2 + 0 + 8 + 0 + 0 + 0 + 128 equal?

Before we answer that, let's get rid of all those zeroes. We don't need them in an addition problem. All we really have to do is solve this puzzle: 2 + 8 + 128 = ? Guess what? The final answer is 138. Congratulations, we've come full circle! Go take a victory lap.

Advertisem*nt

Note that 138 is a whole number. There is a technique for converting numbers with a fractional component, like 0.25 and 3.14, into binary. But full disclosure: It's kind of complicated. If that doesn't bother you and you'd like to learn more, the Institute of Electrical and Electronics Engineers (IEEE) offers a standardized conversion method.

Decimal Conversion Formula

Having changed "10001010" into "138," it's time to reverse our process. Suppose you'd started out with 138 and had to convert it to binary. How would you do it? Once again, exponents are the key to the whole shebang.

Have another look at our "powers of 2" list. Find the value that comes the closest to 138 without exceeding it. A quick reread tells us 138 sits between 256 (which is 28) and 128 (that's 27). Now, we're going to subtract 128 from 138. Here's the equation: 138 - 128 = 10

Advertisem*nt

Next, take that 10 and have a second gander at the exponent list. The power of 2 which comes the closest to equaling 10 is 23, or 8. So at this point, our job is to subtract 8 from 10. Like so: 10 - 8 = 2. And what do you know? The number 2 is equal to 21. This process gave us three important figures: 128, 8 and 2. Our next objective is to add them up: 128 + 8 + 2 = 138.

Interpreting the Decimal Value

Find a piece of paper if you haven't already done so. Write out the value of every exponent of 2 beginning with "128" (remember, that's 27) and "1" (which equals 2). Do this in descending order from left to right. And make sure to leave some space between each number.

Your scribbling should look like this: 128 64 32 16 8 4 2 1. As you can see, there are eight individual values listed here. Draw a downward-pointing arrow (↓) below each value. Then, consult the addition problem we wrote down up above, the one that says 128 + 8 + 2 = 138.

Advertisem*nt

Do you see a "128" in that problem? If so, write a "1" underneath the corresponding arrow. Is there a "64" written in the equation? Nope! So beneath that arrow, we're going to write a "0." Keep to the same pattern and you'll get this:

How to Convert Binary Into Decimal (and Vice Versa) (3)

Look familiar? We're left with 10001010 — and as we've already established, that means "138." So there you go. In short order, you've learned the binary number system, the decimal equivalent, and how to complete the binary to decimal conversion. Then, you've used the decimal number system to dial your way back to only two digits. Our proverbial magician has made the rabbit disappear and brought it back again. Carrots all around!

Now That's Funny

The popular sci-fi comedy series "Futurama" loves itself some math jokes. In the season two episode "The Honking," a haunted mansion is willed to the rascally robot, Bender Bending Rodriguez. When he goes inside, he's terrified to discover a secret binary message that reads "1010011010." Maybe Bender was right to be scared; in decimal form, that translates to "666."

Advertisem*nt

Frequently Answered Questions

What is the binary number 11111111 in decimal?

The binary number 11111111 is equal to the decimal number 255.

Cite This!

Please copy/paste the following text to properly cite this HowStuffWorks.com article:

Citation

How to Convert Binary Into Decimal (and Vice Versa) (2024)
Top Articles
How do I apply for a NAICS code? - NAICS Association
Is a 950 on the PSAT good or bad?
Menards Thermal Fuse
7 C's of Communication | The Effective Communication Checklist
Fat Hog Prices Today
Geodis Logistic Joliet/Topco
Walgreens Alma School And Dynamite
Tabler Oklahoma
About Goodwill – Goodwill NY/NJ
Acbl Homeport
Strange World Showtimes Near Cmx Downtown At The Gardens 16
Https://Gw.mybeacon.its.state.nc.us/App
Craigslist Pets Southern Md
Connexus Outage Map
Lonadine
Breakroom Bw
Clarksburg Wv Craigslist Personals
Conan Exiles Thrall Master Build: Best Attributes, Armor, Skills, More
How Much Are Tb Tests At Cvs
Nashville Predators Wiki
How to Create Your Very Own Crossword Puzzle
1773X To
Pecos Valley Sunland Park Menu
Sef2 Lewis Structure
John Chiv Words Worth
Providence Medical Group-West Hills Primary Care
Zillow Group Stock Price | ZG Stock Quote, News, and History | Markets Insider
Gas Buddy Prices Near Me Zip Code
Cookie Clicker Advanced Method Unblocked
2487872771
Bend Missed Connections
Mississippi Craigslist
Mobile crane from the Netherlands, used mobile crane for sale from the Netherlands
123Moviestvme
Hypixel Skyblock Dyes
Rocketpult Infinite Fuel
Marie Peppers Chronic Care Management
Reborn Rich Ep 12 Eng Sub
Muziq Najm
Hingham Police Scanner Wicked Local
Search All of Craigslist: A Comprehensive Guide - First Republic Craigslist
Birmingham City Schools Clever Login
Sarahbustani Boobs
BCLJ July 19 2019 HTML Shawn Day Andrea Day Butler Pa Divorce
Craigslist Mendocino
Advance Auto.parts Near Me
Unpleasant Realities Nyt
Nfl Espn Expert Picks 2023
Secondary Math 2 Module 3 Answers
Nfhs Network On Direct Tv
4015 Ballinger Rd Martinsville In 46151
What Responsibilities Are Listed In Duties 2 3 And 4
Latest Posts
Article information

Author: Golda Nolan II

Last Updated:

Views: 6025

Rating: 4.8 / 5 (58 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Golda Nolan II

Birthday: 1998-05-14

Address: Suite 369 9754 Roberts Pines, West Benitaburgh, NM 69180-7958

Phone: +522993866487

Job: Sales Executive

Hobby: Worldbuilding, Shopping, Quilting, Cooking, Homebrewing, Leather crafting, Pet

Introduction: My name is Golda Nolan II, I am a thoughtful, clever, cute, jolly, brave, powerful, splendid person who loves writing and wants to share my knowledge and understanding with you.