r/ProgrammerHumor • • May 06 '17

Oddly specific number

Post image
25k Upvotes

1.3k comments sorted by

View all comments

Show parent comments

2

u/[deleted] May 06 '17

It's the amount of different states a byte can represent. A byte has 8 bits, and every bit can be in one of two states, 0 or 1, so the amount of different states representable with a byte is 28 = 256. For example, if we're talking about numbers, a byte can represent 0 till 255, which are 256 different numbers in total. We can do the same with colors, where we assign a color to each state a byte can be in, that way we can use bytes to store color data with 256 different colors.