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

How do computers represent data?

When we look at a computer, we see text and images and shapes.
To a computer, all of that is just binary data, 1s and 0s.
The following 1s and 0s represents a tiny GIF:
A string of 0 and 1 numbers, 336 numbers long.
This next string of 1s and 0s represents a command to add a number:
A 16-character long string of 1s and 0s.
You might be scratching your head at this point. Why do computers represent information in such a hard to read way? And how can 1s and 0s represent so many different things? That's what we'll explore in this lesson.
To start off, check out the next video from Code.org where engineers from Microsoft and Adafruit introduce the basics of bits and binary data.

Want to join the conversation?

  • leafers ultimate style avatar for user Aman Mahmood
    Why do computers use 1s and 0s specifically? Wouldn't it become very challenging for them to convert trillions of 1s and 0s so using 2s, 3s, 4s, etc would shorten the input they need to process?
    (40 votes)
    Default Khan Academy avatar avatar for user
    • blobby green style avatar for user LAINEJOR000
      It really has more to do with the way computers work. At the fundamental level, the transceiver is how the computer interprets anything (this is where you can find binary). A wire can either be sent electrical signals, or it cannot (there is no in between for on and off after all). This means that the representation for when a wire is sent an electrical signal has to be of 2 possible values. As such, binary is used.
      (105 votes)
  • leaf blue style avatar for user texasmartinsmith
    1)
    How much jargon does one need to know before beginning the course?

    2) Is there a jargon dictionary?

    3) What is a GIF?
    (17 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Emarion Spencer
    how is this class going to get better?
    (7 votes)
    Default Khan Academy avatar avatar for user
  • stelly blue style avatar for user linavs046212
    doing AP comp sci this year and I have no idea what im doing and no prior comp sci knowledge lmao. wish me luck
    (12 votes)
    Default Khan Academy avatar avatar for user
  • aqualine seed style avatar for user Maide Ahsen Yücel
    comments are so funny
    (12 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user zlee7846
    why do we have to use 1 and 0's why not different numbers?
    (3 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user JoyceXie
    why would i learn this if i can just use my laptop and roll tiktoks
    (9 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Emmett Harmon
    How do software engineers simplify this coding process? Or do they end up having to enter in all of those ones and zeros
    (4 votes)
    Default Khan Academy avatar avatar for user
    • starky ultimate style avatar for user KLaudano
      Nobody really programs in binary code anymore. People realized a while ago how difficult it is to write programs in binary, so they created alternative programming languages that were much easier to use. Now, we use languages such as Javascript and Python. If you are interested in learning to program, Khan Academy has lessons for beginners.
      (10 votes)
  • male robot hal style avatar for user AnkitT
    me losing brain cells by looking at this
    (8 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user nathan.ting1
    We clawed, we chained, our hearts in vain
    We jumped, never asking why
    We kissed, I fell under your spell
    A love no one could deny
    Don't you ever say I just walked away
    I will always want you
    I can't live a lie, running for my life
    I will always want you
    I came in like a wrecking ball
    I never hit so hard in love
    All I wanted was to break your walls
    All you ever did was wreck me
    Yeah, you, you wreck me
    I put you high up in the sky
    And now, you're not coming down
    It slowly turned, you let me burn
    And now, we're ashes on the ground
    Don't you ever say I just walked away
    I will always want you
    I can't live a lie, running for my life
    I will always want you
    I came in like a wrecking ball
    I never hit so hard in love
    All I wanted was to break your walls
    All you ever did was wreck me
    I came in like a wrecking ball
    Yeah, I just closed my eyes and swung
    Left me crashing in a blazing fall
    All you ever did was wreck me
    Yeah, you, you wreck me
    I never meant to start a war
    I just wanted you to let me in
    And instead of using force
    I guess I should've let you win
    I never meant to start a war
    I just wanted you to let me in
    I guess I should've let you win
    Don't you ever say I just walked away
    I will always want you
    I came in like a wrecking ball
    I never hit so hard in love
    All I wanted was to break your walls
    All you ever did was wreck me
    I came in like a wrecking ball
    Yeah, I just closed my eyes and swung
    Left me crashing in a blazing fall
    All you ever did was wreck me
    Yeah, you, you wreck me
    Yeah, you, you wreck me
    (5 votes)
    Default Khan Academy avatar avatar for user