With iOS 18, iPadOS 18, and macOS Sequoia, Apple introduced the ability to solve equations in its free Notes app: Apple Notes. This is part of a feature called Math Notes, and it saves you the hassle of switching to the Calculator app when you need to perform calculations. You can keep all your work in one place. But there’s one lesser-known feature of Math Notes that makes it even more useful—variables.
Those who know how to code are familiar with variables. They sound complicated at first, but Apple has integrated them into the Notes app in a way that makes them ideal for everyday use. I strongly suggest everyone learn to use them to build dynamic notes that save time and reduce headaches.
I will be using Notes on my iPhone for my examples. Also, keep in mind that Math Notes does not work if you’re using Apple Notes on iCloud.com—it’s built to work with Apple devices.
The beauty of variables in Apple Notes
They aren’t as complicated as they seem
This part assumes you’re completely new to variables. I recommend trying the examples to see how they work. I will use simple calculations, so don’t be intimidated. Now, open a new note and follow along.
A variable is simply a placeholder for storing a value. To create one in Apple Notes, you give it a name and assign it a value using the equals sign. This is called declaring a variable. You can then use it in expressions, equations, and graphs.
Here’s how you declare a variable:
x = 5
Above, we have a variable named x, and we have assigned it the value of 5. So that means x is equal to 5, as far as Notes is concerned. It will, for example, substitute it for 5 in an expression. That means entering the line below will return 8.
x = 5
x + 3 =
There is an equals sign at the end of the expression because that is how Notes knows you want to return a result. Also, when you use the variable in a calculation, it will change color to yellow to signify it’s in use.
You can declare more than one variable in your note and use them both in calculations. So the calculation below should return 12.
x = 3 + 3
y = 2
x * y =
Here is where it gets dynamic. Suppose you have used the variable x in multiple places in your note. Then you realize that x should actually be 6 instead of 5. If you had directly written the value 5 in all those calculations, you’d have to hunt down each instance of the hard-coded value and change it. Now you can change all instances by assigning 6 to x.
x = 6
Notes will instantly fix every calculation. It’s faster, cleaner, and less error-prone. It can get more complicated than this, but this is all you need to know to do something useful with variables.
A few things to keep in mind when using variables in Apple Notes
Firstly, you can name the variable anything, as long as there is no space or special characters. So variableName (this format is known as Camel Case) is a valid name. Secondly, you can only assign them numbers. This is a shame because I consider it a missing Apple Notes feature that would allow for the creation of more advanced templates from within the Notes app.
Related
This Simple Trick Makes Changing Notes on iPhone Easy
Save yourself a few taps.
Thirdly, variables are note-specific, meaning you can’t use a variable declared in one note in another one. Fourthly, the variable names are also not case-sensitive. So, p is the same as P, and variableName is the same as variABlenaMe.
Lastly, variable placement matters. Notes processes everything from top to bottom, meaning you shouldn’t declare a variable after the expression you intended to use it in. Also, the expression is evaluated from left to right (unless operator precedence applies). That means declaring a variable in the manner below will not work because the left side must be a variable name for the assignment to work.
10 = x
Dynamically adjusting your budget
Update your totals on the fly
If you’re using raw figures to create a budget in Notes, I’ll explain why using variables is better. Hard-coding them might save time, but unless you’ve memorized what each figure represents in the calculation, you can easily lose track of everything. This is especially true for large calculations.
With variables, you can create variables for all the items on your grocery list and sum them up in an expression. Then, it’s a matter of assigning the result of that summation to a variable called Groceries.
Afterward, you can use the Groceries variable in a larger calculation for your monthly budget, with variables like Entertainment, PhoneBill, and Rent. The Entertainment variable, for instance, can also be a summation of things like Netflix, Spotify, and movieNight.
You can separate the calculations this way and adjust them when prices change for certain items. The totals will be updated automatically by Math Notes, thanks to the variables.
Dynamically adjusting recipes
No need to bring out the calculator to change quantities
Imagine you got a recipe from the internet that serves four people. But what if you have three, seven, or 12 people? You would need to bring out the calculator every time you need to scale the quantities of the ingredients up or down. Alternatively, you can make it easier with variables.
You use variables to set it up so that all you need to do is input the number of people you need to serve. From there, Math Notes will do the rest and give you the accurate quantities of the ingredients.
Below is the syntax you’d use in the expression to scale a single ingredient. The variable P is the number of people to serve.
(defaultQuantity/defaultNumberOfPeople) * P
Now, suppose one of the ingredients is 400g of pasta, which is the default quantity to serve four people. If you want to make it for three people, you’d write the expression below:
P = 3
Pasta: (400/4) * P
Here, defaultQuantity = 400, defaultNumberOfPeople = 4, and P = 3. The result will be 300, which is the amount of grams of pasta you’d need to serve three people.
Let Apple Notes do all the work—you just need to set it up once
It’s extra work to set up a dynamic note when using variables in Apple Notes. But the best part is that it allows you to create useful tools using this built-in feature, from calculators to templates. If you explore further, you’ll discover that you can use the Shortcuts app with Apple Notes to create productivity-enhancing automations. But that’s a topic for another time.

