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

What is a variable?

Our focus here is understanding that a variable is just a symbol that can represent different values in an expression. We got this. Just watch. Created by Sal Khan.

Want to join the conversation?

  • blobby green style avatar for user Jonathan.Morrell
    Can you use a ! for a variable?
    (221 votes)
    Default Khan Academy avatar avatar for user
  • piceratops ultimate style avatar for user Samuel
    Where did they come up with the name variable?
    (103 votes)
    Default Khan Academy avatar avatar for user
    • male robot donald style avatar for user 16jackl
      If something varies, it changes from time to time. A variable is so named because it is capable of changing, as opposed to a numerical value, which must remain constant. Let me explain.

      x could be anything. 1, 5, 273, 50 trillion--anything. Thus, it can vary in its actual value. This potential variability gives it the name variable. In contrast, the number 5 cannot change its value. It always will be 5. If it held a value of something other than 5, it simply wouldn't be 5. In this way, its value is constant. Hence, it is named a constant.
      (87 votes)
  • old spice man green style avatar for user Alexkramer1220
    How do you graph functions?
    (70 votes)
    Default Khan Academy avatar avatar for user
  • duskpin ultimate style avatar for user Allie Rosa
    I know that x and y are the most common variables, but are you allowed to use other variables to? Like O?
    Wondering,
    Allie
    (33 votes)
    Default Khan Academy avatar avatar for user
  • spunky sam red style avatar for user Keerthana Revinipati
    So, the only reason we use lowercase letters for variables is to keep things simple? So that means we can still use words, but letters is easier, right?
    (18 votes)
    Default Khan Academy avatar avatar for user
    • male robot johnny style avatar for user Pablo  Pena
      Letters are just shorter representations of objects. If we have 10 apples, it would be easier to write 10x, where x is being used to represent apples. It is much easier to use letters to represent variables rather than to write apples or whatever variable is being used.
      (6 votes)
  • starky sapling style avatar for user Jada
    and what is tips
    what is a variable
    why do we use them
    who created them
    (6 votes)
    Default Khan Academy avatar avatar for user
    • hopper jumping style avatar for user Lucas De Oliveira
      In this case, tips are the sum of money given to someone as a reward for a service. For exemple: give a tip for a good waiter.
      Now, a variable can be anything, it depends of the statement. In Math, when you make a statement, then it can be false or true. But, if you put a variable in a statement, so the proposition can be false and true either for different values. Therefore, a variable works how a question. For exemple:
      x + 2 = 4 . I have a statement and x is a variable because it can be any real number, but in truth it is a question: what numbers i can put in place the x and the results will be true? The answer how you know is 2. More one: y - 5 = 2 + x. Now, you have 2 variables and several responses. Thats why we use them: to work when we dont know the answer yet. In a function, for exemple, we have two variables: one is independent and other is dependent for the first one which means that when you change intentionally the independent then the dependent changes too. The speed is a exemple: if you have a constant speed, then the distance is the dependent variable and the time is the independent variable. How much more time pass, the distance you traveled increase in a same speed.
      François Viète introduced at the end of 16th century the idea of representing known and unknown numbers by letters, nowadays called variables, and of computing with them as if they were numbers, in order to obtain, at the end, the result by a simple replacement. François Viète's convention was to use consonants for known values and vowels for unknowns.
      In 1637, René Descartes "invented the convention of representing unknowns in equations by x, y, and z, and knowns by a, b, and c". Contrarily to Viète's convention, Descartes' is still commonly in use. I hope to have could help you. Good luck!
      (21 votes)
  • hopper cool style avatar for user Vaishavi Pandey
    Why are x and y the most common variables?
    (4 votes)
    Default Khan Academy avatar avatar for user
  • mr pink red style avatar for user Gracie B.
    Are variables hard and do they get harder in every grade you go in?
    (5 votes)
    Default Khan Academy avatar avatar for user
    • blobby green style avatar for user Baldassare
      Variables are hard at first. Variables themselves get easier to use the more you use them, as with any concept. Math classes tend to get harder because they will expect you to use more variables in different ways. Yet the harder the math you do, the easier it becomes to use variables, and other ideas, to solve problems in your life. For example, what score do you need on your next test to get an A? This is a question that is much easier to answer using variables than without them.
      (12 votes)
  • winston baby style avatar for user AndrewTheKim
    are variables used in things that are not math? if yes, then what?
    (5 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user xavier boyd
    can variables be anything else but x?
    (3 votes)
    Default Khan Academy avatar avatar for user
    • stelly blue style avatar for user Kim Seidel
      Yes, any letter could be used as a variable, though "x" is the most commonly used. There are some letters that people stay away from because they look too much like numbers, for example: lower case L look like one (1); the letter O looks like zero (0).
      (8 votes)

Video transcript

Let's say that I'm working in a restaurant, and I'm making $10 per hour. But on top of my hourly wage, I also get tips each hour. So this entire expression, you can view this as how much I might make in a given hour. Now, you might also realize that the number of tips or the amount of tips I might make in an hour can change dramatically from hour to hour. It can vary-- one hour it might be lunchtime, get a lot of tips, people might get some big-ticket items. The next hour, I might not have any customers. And then my tips might be really low. So the tips part right over here, we consider that-- the entire word, we consider that to be a variable. From scenario to scenario, it can change. So for example, in one scenario, maybe it's lunchtime. I'm getting really big tips. So tips is-- let's say it's equal to $30. And so the total amount I might make in that hour-- we can go back to this expression right over here-- it's going to be 10 plus-- instead of writing tips here, I'll write 30 because that's what my tips are in that hour. And so that is going to be equal to 40. Let me do it in that yellow color. It's going to be equal to $40. But let's say right after that, the restaurant slows down. We're out of the lunch hour for whatever reason. Maybe the restaurant next door has a big sale or something. And so the next hour, my tips go down dramatically. My tips go down to $5 for that hour. Now I go back to this expression. The total I make is my hourly wage plus the $5 in tips, which is equal to $15. As you see, this entire expression-- the 10 plus tips-- it changed depending on what the value of the variable tips is. Now, you won't see whole words typically used in algebra as variables. We get lazy. And so instead, we tend to use just easier-to-write symbols. And so in this context, instead of writing tips, maybe we could have just written 10 plus t, where t represents the tips that we get in an hour. And so then we would say, OK, what happens when t is equal to 30? Well, then, we have a situation. t is equal to 30. This evaluates to 10 plus 30, which would be 40. What would happen if t is equal to 5? Well, then, this would evaluate to 10 plus 5, which is equal to 15. Now, I want to be clear. We didn't even have to use t. We didn't even really have to use a letter, although in traditional algebra, you almost do use a letter. We could have written it as 10 plus x, where x is your tips per hour. x might not be as natural. It's not the first letter in the word tips. Or you could have even written 10 plus star, where you could say star represents the number of tips in an hour. But it just might have not made as much intuitive sense. But hopefully this gives you a general idea of just what a variable is. All it is is a symbol that represents varying values. And that's why we call it a variable.