If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Bits (binary digits)

Computers store information using bits. A bit (short for "binary digit") stores either the value 0 or 1.

What fits in a bit?

A single bit can only represent two different values. That's not very much, but that's still enough to represent any two-valued state.
Is a lightbulb on or off?
A lightbulb that's off
A lightbulb that's on
Is a button enabled or disabled?
An enabled button that says "Submit"
A disabled button that says "Submit"
Is the current time AM or PM?
An alarm clock that says "9:35 AM"
An alarm clock that says "9:35 PM"
Check your understanding
Consider this settings screen for a Khan Academy user:
Screenshot of Khan Academy account setting screen with four settings: User name (a text field with the string "foxhound"), Birthdate (a date field with 7/10/1981), Primary language (a dropdown with "English" selected), Sound effects (a checked checkbox).
Which of the settings can be stored in a single bit?
Choose all answers that apply:

Sequences of bits

Computers use multiple bits to represent data that is more complex than a simple on/off value.
A sequence of two bits can represent four (22) distinct values:
00, 01, 10, 11
A sequence of three bits can represent eight (23) different values:
000, 001, 010, 011, 100, 101, 110, 111
A sequence can represent many things: a number, a character, a pixel. Plus, the same sequence can represent different types of data in different contexts. The sequence 1000011 could represent 67 in a calculator application while also representing the letter "C" in a text file. Learn more in our lessons on Binary numbers and Storing text in binary
Check your understanding
How many different values can four bits represent?
  • Your answer should be
  • an integer, like 6
  • a simplified proper fraction, like 3/5
  • a simplified improper fraction, like 7/4
  • a mixed number, like 1 3/4
  • an exact decimal, like 0.75
  • a multiple of pi, like 12 pi or 2/3 pi

Physical storage

Computers typically store bits using electromechanical transistors which can map electrical signals to either an on or off state. Learn more in our article From electricity to bits or this video on how transistors work.

🙋🏽🙋🏻‍♀️🙋🏿‍♂️Do you have any questions about this topic? We'd love to answer— just ask in the questions area below!

Want to join the conversation?