Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

Counting to 7 in binary looks like this:

0 1 10 11 100 101 110 111

The highest value is always to the left. But would it make more sense to to it like this? Is there a way that this was picked, or was it a random decision?

0 1 01 11 001 101 011 111

share|cite|improve this question

marked as duplicate by Claude Leibovici, HK Lee, Harish Chandra Rajpoot, hardmath, Daniel W. Farlow Feb 19 at 13:27

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Congrats, you've stumbled on the problem of big-endian vs. little-endian! – DylanSp Feb 18 at 19:59
This is a property of the positional notation, which is not limited to the base of 2. Compare to Roman numbers – null Feb 18 at 20:09
@DylanSp Endianness is byte order, not bit order. – NobodyNada Feb 18 at 21:24
@DylanSp This is about bit numbering, not endianness. – isanae Feb 18 at 22:05
Related:… – Henry Feb 19 at 0:50

It's an arbitrary convention that we write 42 to mean 4 tens and 2 ones, as opposed to 4 ones and 2 tens. Somewhere down the line it was decided, and we've been stuck with it ever since. The way binary numbers (base 2) are represented follows the convention for base 10 numbers: the binary number 110 represents 1 four, 1 two, and 0 ones.

The convention of writing the most significant bits first is called big-endian bit order, while the reverse convention is called little-endian.

share|cite|improve this answer
I would say your use of the word "mirrors" is open to misinterpretation here! I suggest "follows". – TonyK Feb 18 at 20:11
Good catch! Edited. – Lothar Narins Feb 18 at 20:16
As mentioned by @NobodyNada and others, endianness refers to byte (or word) order, not bit order. But otherwise you're right and it's a very similar idea. See – Vaz Feb 18 at 22:10
"Endianness" is also used to refer to dates (with the US format being called "middle-endian"). The term was coined to refer to byte-order for machine storage and transmission, but its extension to positional notations in general is so obvious as to be unavoidable. – Steve Jessop Feb 18 at 23:19
The question doesn't mention bits in a byte. It doesn't mention bytes at all, and this is math.SE, not Stack Overflow. It's about writing numbers in binary in English text, it's not a question about computer storage. If it was about bytes, then arguably counting doesn't look like $0, 1, 10, 11$, as stated in the question. Instead it looks like 00000000, 00000001, 00000010, 00000011 :-) – Steve Jessop Feb 19 at 3:05

You might as well have asked why are decimal numbers ordered the way they are, that is, "four hundred and forty two" is written like this: 442 (least significant digit to most significant digit from right to left).

It might seem counter-intuitive at first because Latin languages are written from left to right, however, if you investigate further you'll find that the modern number system was based on Arabic language (and then developed to be closer to what it is today), And Arabic is a language that's written from right to left. (correct me if I'm wrong though)

So this rule really follows any number system: significance of the digits is in ascending order from right to left.

EDIT: Apparently (as per the comments) the right-to-left convention had even existed way earlier than that:

share|cite|improve this answer
Although Arabic as a whole is indeed written right to left, numbers are written big-endian, which makes some sense since Arabic numbers were themselves borrowed from India, where they are also big-endian. – amd Feb 18 at 21:03
AFAIK, this question has nothing to do with big or little endian as these are schemes of storing data in computer memory. Not a single bit of the question is suggesting that the OP is talking about computation at all. So my answer is more on the general sense. I really am confused as to why people are mentioning it. Maybe I don't fully understand what's meant by endianness. – Ahmed Elyamani Feb 18 at 21:08
They’re just using it a shorthand for “written with the most significant digit first” and “written with the least significant digit first.” The parallel with storage order within computer memory should be obvious. – amd Feb 18 at 21:09
@amd: Careful, though: it's my understanding that "big-endian" and "little-endian" refer to the ordering of words, not the ordering of bits, so the terms are only really apropos in this discussion if you think in base 256, where a word is a single digit. The confusion is exacerbated by the fact that the OP is asking specifically about the ordering of bits in a byte, which is not affected by endianness. – Vectornaut Feb 18 at 23:32
The Indians wrote numbers the same way we do, with the highest unit on the left; note that Indic writing systems are left-to-right. This has to do with how numbers are named; in indoeuropean languages, the higher unit generally comes first. The Arabs borrowed the system and continued writing the same way, because their language names numbers starting from the lower unit. When Fibonacci took the system to Europe, he didn't change the direction in writing numbers. – egreg Feb 18 at 23:55

Not the answer you're looking for? Browse other questions tagged or ask your own question.