Why is the number range 0-255 common in many computer files?

1.21K views

Why is the number range 0-255 common in many computer files?

In: Technology

6 Answers

Anonymous 0 Comments

Because that is exactly one byte worth of counting.

Computers count in binary and humans count in decimal.

When humans think of round numbers they think of numbers like 100 or 1000 or 50 or 1,000,000; powers of 10 or at least multiples or simple fractions of powers of ten.

For the way computers count powers of 2 are round numbers.

While in human terms or at least in European ones we tend to group 3 digits together to get thousands and million and billion, for computers we tend to group 8 binary digits together.

8 binary digits (bits for short) together make a byte. This is a grouping used by computers deep down on the hardware level and thus present everywhere in computing.

One byte has 2^8 different possible values. It can be used to represent values of 0 to 255 or -128 to +127 if you use it to count whole numbers (called integers in computing).

The same way that a 3 digit decimal number can go from 0 up to 999, an 8 bit number can go from 0 to 255. It is simply when you run out of digits.

Other examples of numbers represented by whole bytes cropping up frequently is 16 bit or 2 bytes which from 0 goes up to 65,535 aka 64k different values. or 3 byte/24-bit which can be used to represent 16,777,216 different values.

These are the sort of number that are round numbers for computer and those using them.

You are viewing 1 out of 6 answers, click here to view all answers.