OtterCalcOtterCalc

Basics

Your first calculation, variables, notes, and how numbers work.

OtterCalc is a notepad that does math. Type a calculation on any line and the answer appears on the right, instantly. There is no equals button and no cell references to learn. Try changing a number in any example on this page: they are all live.

2500 - 800
15 * 4 + 60
1,700
120

Variables

Give a value a name with the = sign, then use that name anywhere below. Names can be several words long, spaces included, and capitalization does not matter. Both directions work: name = expression, or expression = name when the result comes first in your head.

salary = 2500
rent = 800
left over = salary - rent
salary - 300 = savings goal
2,500
800
1,700
2,200

Redefining a variable

You can give the same name a new value further down. Lines below the new value use it; lines above keep the old one. This works like reading a page from top to bottom.

price = 100
price * 2
price = 150
price * 2
100
200
150
300

Headings, labels and comments

Give a document structure without leaving the keyboard. Start a line with # for a heading (## for a smaller one); it renders bold and shows no result. Put a label before a colon, like Rent: $2,500, and the label is bold while the amount still calculates. Lines starting with // are comments (dimmed, ignored), and you can add // to the end of a calculation too. Any other non-math line is plain text, and a blank line or a heading also starts a new section for totals and charts. One label is special: result: (or answer:) marks the page's answer, and the editor sets that line and its value large.

# Monthly budget
Rent: 2500
Groceries: 400
total
// prices from last receipt
milk = 4.50 // two cartons
result: 2500 + 400
2,500
400
2,900
4.5
2,900

Words next to numbers

Labels that sit right next to a number are ignored in the math, so you can annotate as you go. This only happens when the line is clearly a calculation. A misspelled variable name is never silently ignored: you get a clear error instead of a wrong answer. While you are still typing, a half-finished line like 5 + or 2 * (3 stays calm and shows a partial result rather than flashing an error at you.

hotel $120 + dinner $45
rent = 800
rnt + 100
$165.00
800
? Unknown: rnt

How to write numbers

Use a dot for decimals: 1234.56, or lead with the dot for values below one, so .5 means 0.5. To group big numbers, a comma, an underscore, an apostrophe, or a plain space all work: 1,000,000 and 1_000_000 and 1 000 000 are the same million. Shortcuts: 45k, 1.5M, 2B, words like 2 million (Spanish uses the long scale: 1 billón is a million millions), and scientific input like 1e5. Results display in your own language format. In the Spanish and French interface you can also write numbers your way: 1.200,50 and 5,5% read as a Spanish or French reader expects (a dot followed by three digits is a group, a comma is the decimal), while 1.5 stays a decimal. English-style numbers mean the same thing in every language; the Spanish and French forms are read by whoever opens the document in their own interface language, so prefer the dot style in documents you share across languages. For hex, binary and octal bases, bitwise math, and scientific-notation output, see Advanced.

45k + 1.5M
1_000_000 + 1
.5 + .25
2 million
1,545,000
1,000,001
0.75
2,000,000

Rounding, in plain words

Ask for the rounding you mean: rounded, rounded up, rounded down, to 2 dp for decimal places, or to nearest 10 for tidy steps. It works on money too, and the unit stays.

5.5 rounded
1/3 to 2 dp
37 to nearest 10
$490 to nearest 100
6
0.33
40
$500.00

Words work as operators too

Write math the way you say it: plus, minus, times, divided by, to the power of. A lone x between two numbers multiplies too, so 12 x 3 is 36. The rule of three answers proportion questions directly.

30 plus 20
12 x 3
3 to the power of 2
square root of 81
6 is to 60 as 8 is to what
50
36
9
9
80

Functions and precision

Functions: sqrt, cbrt, abs, round, floor, ceil, min, max, sum, mean, median, gcd, lcm, factorial (or write 5!), and the trig and log family (sin, cos, tan, log, ln) when called with parentheses. log is base 10 and ln is the natural log. Constants pi and e. Square and curly brackets group exactly like parentheses, so [2 + 3] * {4 - 1} is 15 and you can nest them any way you like. All math runs at 64 digits of precision, so 0.1 + 0.2 is exactly 0.3.

sqrt(144)
log(1000)
5!
0.1 + 0.2
12
3
120
0.3