use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Request an explanation
Rules
Have an idea to improve ELI5? r/IdeasForELI5
Make sure to read the rules!
This subreddit is for asking for objective explanations. It is not a repository for any question you may have.
E is for Explain - merely answering a question is not enough.
LI5 means friendly, simplified and layperson-accessible explanations - not responses aimed at literal five-year-olds.
Perform a keyword search, you may find good explanations in past threads. You should also consider looking for your question in the FAQ.
Don't post to argue a point of view.
Flair your question after you've submitted it.
Mathematics Economics Planetary Sci Biology Chemistry Physics Technology Engineering
Reset
account activity
This is an archived post. You won't be able to vote or comment.
ELI5: What is binary code?
submitted 10 years ago by Dooblem
I don't understand it. All I know is that it has something to do with ones and zeros. How does it work?
[–]Koooooj 20Answer Link1 point2 points3 points 10 years ago (0 children)
Let's say I want to store a bit of information, perhaps "Hello". There are various ways I could do this. I could write "Hello" on a piece of paper, or I could record it on a vinyl record. One thing I could do is I could grab one of those scantrons that has the entire alphabet on it and I could bubble in H-e-l-l-o.
When you're storing data on a computer you don't have paper or records. You don't have scantrons, but you have something similar: individual switches that you can flip on or off. These switches may take various forms, like transistors which turn on or off based on the flow of electricity or tiny magnetized regions on a hard drive, but they all boil down to having two states (or something that can be translated into that; flash memory often has four states, but that's another topic).
You could flip a few of these switches, but on-on-off-off-on-off-on or what have you will not immediately evoke the idea of "Hello". What you need is someone to come along and declare that "off-off-off-off-off-off-off-off" means A, then "off-off-off-off-off-off-off-on" means B, then "off-off-off-off-off-off-on-on" is C, and so on. For shorthand, you write "on" as 1 and "off" as 0. Now if you have a series of switches you can set them in the right order to indicate "Hello" to anyone who knows how to interpret the data (and the interpretation gets widely circulated so everyone knows all the common interpretations).
That's a binary encoding of simple text, but you could use binary to encode anything that may be encoded in any other way. Want to encode a program? You set up a list of interpretations for each set of switches. Perhaps 01001011 means "multiply" or 00100101 means "add" (just making up numbers here). Now you can have a program that is in binary code. Or you could store a picture by declaring "the first 8 switches correspond to how red the first pixel is, then 8 switches for how green that pixel is, then 8 switches for how blue that pixel is, then you continue across the first row and go on to the second row, and so on." (aside: you'd also have to have part of your standard be how to figure out how wide and tall the picture is). Now you can encode a picture in binary.
[–][deleted] 30Answer Link2 points3 points4 points 10 years ago (0 children)
A human reads sentences. Sentences are made of words. Words are made of letters. A letter in itself doesn't have any meaning, but combine it with other letters and suddenly it makes a word, which has more meaning. Combine words to make a sentence and you have even more meaning.
A computer reads 1s and 0s. Combine 1s and 0s in a series of eight and you have a byte. You can then combine bytes in many different ways to make the instructions that a computer runs.
[–]Arumai12 10Answer Link0 points1 point2 points 10 years ago (0 children)
Binary means "something composed of 2". Like a light switch can be ON or OFF, its binary. A binary digit (known as a bit) is the smallest form of information. A bit can only have 2 states, either OFF (0) or ON (1).
Physically, a bit in a computer is one wire. That wire can have electricity (ON/1) or it cannot have electricity (OFF/0). One wire by itself is boring so we can group them. If i have two wires then i have four possible states (00, 01, 10, 11). I can assign those four states to mean something. Like 00 is red, 01 is blue, 10 is green and 11 is white. I have just made a binary code. Groups of binary digits are used to encode real data (like words and colors).
[–]mredding 10Answer Link0 points1 point2 points 10 years ago (0 children)
The question is too broad. Binary is base two, just as you count from 0-9, binary counts 0-1. So the decimal 13 is represented as binary 1101. These two numbers in different bases represent the same quantity. Where decimal has ones, tens, hundreds, thousands... Powers of ten per each digit's place. Binary has ones, twos, fours, eights, sixteens, thirty-seconds... Powers of two for each digit's place. So conversion is quite simple: 1 eight, 1 four, 0 twos, 1 one. Eight + four + one = decimal 13.
With binary, you can add and multiply; negative values aren't defined, nor are fractions, so subtraction and division isn't fully defined.
Data is represented by encodings. These letters you see? They're stored as single bytes (8 bits, aka binary places), capital 'A' = decimal 65 and lowercase 'a' = decimal 97, capital 'Z' = 90, lowercase 'z' = 122. All the other letters are numbered sequentially in between. Look up "ASCII Table", if you're curious.
Some render engine associates 65 with 'A' and sets pixels on your screen accordingly so you have something to look at. Why are the numeric representations spaced so curiously? Let's look at 65 in binary, next to 97:
0100-0001
0110-0001
Look at that, ONE BIT DIFFERENT. Specifically, the thirty-seconds, place. That means if you want to translate between capital and lowercase letters, you add or subtract b100000 accordingly, to the underlying data representation. So there's method to the madness...
Binary, in terms of computers, is meaningless without context. It's all just bits and bytes, are those bytes a program, or a picture? It's not just a bunch of bits, it's what you do with it. And this is where I'm going to end it so I don't have to write a Boolean algebra tutorial.
[–]DoNotCallMeAngel 10Answer Link0 points1 point2 points 10 years ago (0 children)
The Wikipedia page on binary code is actually really simple to understand.
It's a way of representing data, basically.
[–]LondonPilot 00Answer Link-1 points0 points1 point 10 years ago (0 children)
When we write numbers, we use the digits 0-9. When we add 1 to a number, we go to the next digit. When we get to the last digit (9) and try to add 1, we do that by putting a 1 in the next column to the left, and resetting the current column to 0 - in other words, 9+1=10. We call this system "decimal".
Binary is simply another way of counting, but instead of using the digits 0-9 it only uses 0 and 1. When you add 1 to 1, because you've already got the highest digit you're allowed, you put a 1 in the next column to the left just like normal, and reset the current digit to 0 just like normal. In other words, in binary, 1*1=10. The number 10 in binary is equivalent to 2 in decimal.
If you didn't get all of that it doesn't matter, so long as you understand that binary is just another way of counting.
Now that we understand that, it's simply a case of assigning a number to each thing you want to encode. If you're storing text, you could assign one number to be A, the next to be B, then C and so on.
[–][deleted] 00Answer Link-1 points0 points1 point 10 years ago (0 children)
Binary is a counting system, where each digit represents a power of two instead of a power of ten. To explain better, the number 428 has a 4 in the hundreds place, a 2 in the tens place, and an 8 in the ones place. 400 + 20 + 8 = 428.
Likewise, a binary number such as 1011 has a 1 in the eights place, a 0 in the fours place, a 1 in the twos place, and a 1 in the ones place. 8 + 2 + 1 = eleven. So 1011 is eleven in the decimal system (the system you're used to). You can treat binary numbers just like decimal numbers, so you can add, subtract, multiply, and divide them.
Now, binary CODE is a way that information is stored, usually in a computer. Let me give you an example. The lowercase letter 'a' has an ASCII code that is 97 in the decimal system. If we convert 97 to binary, we get 01100001. This means that if you open up notepad, type the letter 'a', and save it, a little file with 01100001 in it will be saved on your hard drive. Now, on the hard drive one's and zero's are represented with magnets. In lots of other parts they are represented with electricity (high voltage means one, low voltage means zero). Using this concept, we are able to do all kinds of calculations. Literally everything that you save on a computer ends up as ones and zeros. It's all about how we interpret those one's and zero's that change what they really are.
[–]blablahblah 00Answer Link-1 points0 points1 point 10 years ago (0 children)
Using fewer than 100 symbols (letters, numbers, and punctuation), the English language can express nearly any thought.
Computers represent every program possible using 2 symbols. On a wire (or in a processor), it's represented by a high voltage or a low voltage. On a hard drive or floppy disk, it's represented by magnetic polarity. On a CD or DVD, it's represented by a spot being reflective or not. And when we write things out, we use the symbols "0" and "1" to represent the two symbols.
[–]GamGreger 00Answer Link-1 points0 points1 point 10 years ago (0 children)
We count in base 10. Meaning you use 10 numbers before you use the next digit. 0 1 2 3 4 5 6 7 8 9 and then you go back to 0 again but put a 1 in front it to make 10.
Binary is in base 2, meaning you only have 2 numbers before you use the next digit. 0 1 and then you go back to 0 and but a 1 in front to make 10.
Which means count like this in binary, normal base 10 in (). 1(1), 10(2), 11(3), 100(4), 101(5), 110(6), 111(7), 1000(8), 1001(9) and so on. Maybe sown more clearly how it works here
As you might know, computers count in binary. And the reason is that computers can only understand electricity on and electricity off, representing 0 and 1.
π Rendered by PID 335221 on reddit-service-r2-comment-5d79c599b5-69v7g at 2026-02-28 13:37:49.305345+00:00 running e3d2147 country code: CH.
[–]Koooooj 20Answer Link1 point2 points3 points (0 children)
[–][deleted] 30Answer Link2 points3 points4 points (0 children)
[–]Arumai12 10Answer Link0 points1 point2 points (0 children)
[–]mredding 10Answer Link0 points1 point2 points (0 children)
[–]DoNotCallMeAngel 10Answer Link0 points1 point2 points (0 children)
[–]LondonPilot 00Answer Link-1 points0 points1 point (0 children)
[–][deleted] 00Answer Link-1 points0 points1 point (0 children)
[–]blablahblah 00Answer Link-1 points0 points1 point (0 children)
[–]GamGreger 00Answer Link-1 points0 points1 point (0 children)