What is the answer with PEMDAS?
Type an expression such as 3 + 6 × (5 + 4) ÷ 3 − 7. The calculator works it out by PEMDAS, one operation per step, with no rounding.
- Answer
- 14
3 + 6 × (5 + 4) ÷ 3 − 7 = 14.
- Read as
- 3 + 6 × (5 + 4) ÷ 3 − 7
- Steps
- Add inside the parentheses: 5 + 4 = 9, so 3 + 6 × 9 ÷ 3 − 7; Multiply: 6 × 9 = 54, so 3 + 54 ÷ 3 − 7; Divide: 54 ÷ 3 = 18, so 3 + 18 − 7; Add: 3 + 18 = 21, so 21 − 7; Subtract: 21 − 7 = 14
Answer: 14. 3 + 6 × (5 + 4) ÷ 3 − 7 = 14.
Step by step, in PEMDAS order
How to calculate
Evaluates an arithmetic expression by the order of operations (PEMDAS): parentheses, exponents, multiplication and division, then addition and subtraction, one exact step at a time.
Example with the default inputs (Expression 3 + 6 × (5 + 4) ÷ 3 − 7): 3 + 6 × (5 + 4) ÷ 3 − 7 = 14.
Method: Parentheses first (the deepest, then the leftmost), then exponents (from the right), then multiplication and division from left to right, then addition and subtraction from left to right; one operation per step, in exact fractions.
- Numbers are read exactly as typed; the answer is exact (a whole number, a decimal that ends, or a fraction).
- −3^2 means −(3^2) = −9; write (−3)^2 for 9. 2^3^2 means 2^(3^2).
- A multiplication written without a sign, as in 2(3 + 1), is an ordinary × and is done left to right with ÷: 8 ÷ 2(2 + 2) = 16.
- Exponents must be whole numbers, so every answer is exact. 0^0 and division by 0 have no answer.
Worked examples
Each example is checked against the calculator on every build.
- Expression 3 + 6 × (5 + 4) ÷ 3 − 7 gives Answer 14, Steps Add inside the parentheses: 5 + 4 = 9, so 3 + 6 × 9 ÷ 3 − 7; Multiply: 6 × 9 = 54, so 3 + 54 ÷ 3 − 7; Divide: 54 ÷ 3 = 18, so 3 + 18 − 7; Add: 3 + 18 = 21, so 21 − 7; Subtract: 21 − 7 = 14.Source: Order of operations as in OpenStax Prealgebra 2e, section 2.1: https://openstax.org/books/prealgebra-2e/pages/2-1-use-the-language-of-algebra
- Expression 3 + 4 × 2 − 6 ÷ 3 gives Answer 9.
- Expression 8 ÷ 2(2 + 2) gives Answer 16, Read as 8 ÷ 2 × (2 + 2), Note A multiplication written without a sign, as in 2(3 + 1), counts as an ordinary × here and is done left to right with ÷. To multiply first, put the product in parentheses..
- Expression -3^2 + (1 - 4)^2 gives Answer 0, Steps Subtract inside the parentheses: 1 − 4 = -3, so -3^2 + (-3)^2; Exponent: 3^2 = 9, so -9 + (-3)^2; Exponent: (-3)^2 = 9, so -9 + 9; Add: -9 + 9 = 0.
- Expression 2^3^2 gives Answer 512.
- Expression 1 ÷ 3 + 1 ÷ 4 gives Answer 7/12, As a decimal 0.583333, Steps Divide: 1 ÷ 3 = 1/3, so (1/3) + 1 ÷ 4; Divide: 1 ÷ 4 = 0.25, so (1/3) + 0.25; Add: (1/3) + 0.25 = 7/12.
- Expression (2 + 1) ÷ 9 gives Answer 1/3, As a decimal 0.333333.
- Expression 0.1 + 0.2 × 3 gives Answer 0.7.
How it works
Reading the expression. You can type numbers (digits with an optional decimal point, such as 12, 0.25 or .5, read exactly), the operations +, - (or −), * (or ×, ·, x), / (or ÷), ^ (or **), and brackets ( ), [ ] or { } (each must be closed by the same kind). A minus sign in front of something makes it negative, and a plus sign in front of something is ignored (+3, 2 ++ 3). A bracket right after a number or a closing bracket means multiply: 2(3 + 4) is 2 × (3 + 4). A number right after a closing bracket needs a sign: (2 + 3)4 gives a message, (2 + 3) × 4 works. Two numbers side by side, commas, and other characters are not allowed.
Rank of the operations. From highest to lowest:
- Parentheses (brackets): what is inside is worked out first.
- Exponents. They group from the right:
2^3^2is2^(3^2). An exponent binds tighter than a minus sign in front:-3^2is-(3^2)= −9, while2^-2is2^(-2). - Multiplication and division, equal rank, from left to right. A multiplication written without a sign has the same rank as ×, so
8 ÷ 2(2 + 2)is8 ÷ 2 × (2 + 2)= 16. - Addition and subtraction, equal rank, from left to right.
One operation per step. An operation is ready when both of its sides are single numbers. At each step the calculator picks one ready operation:
- the one inside the most parentheses (the deepest);
- among those, the one in the leftmost pair of parentheses (or outside all parentheses, if none);
- among those, the highest rank: exponent, then × and ÷, then + and −;
- among those, the leftmost.
It replaces that operation with its exact value. Parentheses around a single number are then dropped, and a minus sign in front of a number joins the number (−(−3) is 3).
Exact values. All values are exact fractions. Exponents must be whole numbers; a negative exponent gives the reciprocal (2^(-2) = 0.25). 0^0, division by 0, and 0 to a negative power have no answer, and two size rules keep answers exact and quick. Let the size of a fraction p/q be the number of binary digits of |p| plus that of q (a whole number n is n/1, and 1 has 1 binary digit). A power a^e, other than 0, 1 or −1 to any power, gives no answer ("too large to show exactly") when |e| × the size of a is more than 100,000: 2^33333 (3 × 33,333 = 99,999) works and 2^33334 does not. Any step whose result has a size over 100,000 gives no answer too.
The calculator shows:
- Answer: a whole number (
14), a decimal that ends, written in full (0.7,-2.75), or else a fraction in lowest terms (7/12,-1/3). A minus sign is a plain hyphen, with no thousands separators. - As a decimal: only when the answer is a fraction: its decimal value (the nearest 64-bit float), shown to at most 6 decimal places. It is left out when that value is beyond the largest 64-bit float (about 1.8 × 10^308, as for 2^1100 ÷ 3); the exact fraction is still the answer.
- Read as: the expression as the calculator reads it, before the first step: parentheses around a single number are dropped and a minus sign in front of a number joins it (
2(3)(-4)is read as2 × 3 × (-4)), and it is written the same way as the steps. - Steps, joined by a semicolon and a space. Each step is
<Operation>: <left> <sign> <right> = <value>, followed by, so <the whole expression now>unless the expression is now a single number. The operation words areExponent,Multiply,Divide,AddandSubtract, followed byinside the parentheseswhen the operation is inside at least one pair of parentheses. An expression that is a single number has the one stepThere is nothing to work out: the expression is a single number. - Note: shown when a multiplication written without a sign comes after a ÷ in the same run of × and ÷ (as in 8 ÷ 2(2 + 2)). It reads: "A multiplication written without a sign, as in 2(3 + 1), counts as an ordinary × here and is done left to right with ÷. To multiply first, put the product in parentheses."
How expressions are written (in the steps and in "Read as"): the signs are +, − (U+2212), × and ÷ with a space on each side, and ^ with no spaces. All brackets are written as round parentheses. A number is written as in the answer; a fraction is always put in parentheses ((1/3) × 3), and a negative number is put in parentheses unless it is the first thing in the expression or in a pair of parentheses (2 − (-2), -9 + 1). The base of an exponent is put in parentheses when it is negative or a fraction ((-3)^2). A minus sign in front of a group or an exponent is written - right before it (-(2 + 3), -3^2).
Worked examples by hand
3 + 6 × (5 + 4) ÷ 3 − 7. Parentheses: 5 + 4 = 9, giving 3 + 6 × 9 ÷ 3 − 7. Multiply and divide from the left: 6 × 9 = 54, then 54 ÷ 3 = 18, giving 3 + 18 − 7. Add and subtract from the left: 3 + 18 = 21, then 21 − 7 = 14.
3 + 4 × 2 − 6 ÷ 3. 4 × 2 = 8 and 6 ÷ 3 = 2 come first: 3 + 8 − 2 = 9.
8 ÷ 2(2 + 2). Parentheses: 2 + 2 = 4, giving 8 ÷ 2 × 4. Left to right: 8 ÷ 2 = 4, then 4 × 4 = 16.
−3^2 + (1 − 4)^2. Parentheses: 1 − 4 = −3, giving −3^2 + (−3)^2. Exponents, left first: 3^2 = 9, so −9 + (−3)^2; then (−3)^2 = 9, so −9 + 9 = 0.
2^3^2. Exponents group from the right: 3^2 = 9, then 2^9 = 512.
1 ÷ 3 + 1 ÷ 4. 1 ÷ 3 = 1/3 (kept as a fraction), 1 ÷ 4 = 0.25, and 1/3 + 1/4 = 4/12 + 3/12 = 7/12, about 0.583333.
(2 + 1) ÷ 9. 2 + 1 = 3, and 3 ÷ 9 = 1/3, about 0.333333.
0.1 + 0.2 × 3. 0.2 × 3 = 0.6, then 0.1 + 0.6 = 0.7, exactly.
Other questions people ask
What does PEMDAS stand for?
Parentheses, Exponents, Multiplication and Division, Addition and Subtraction. Work inside parentheses first, then exponents, then multiplication and division from left to right, then addition and subtraction from left to right. Some countries say BODMAS or BIDMAS (Brackets, Orders or Indices, Division and Multiplication, Addition and Subtraction); the rules are the same.
Does multiplication come before division?
No. Multiplication and division have the same rank, so they are done from left to right, whichever comes first. 12 ÷ 4 × 3 = 3 × 3 = 9, not 12 ÷ 12 = 1. The same is true for addition and subtraction: 10 − 4 + 2 = 8.
What is 8 ÷ 2(2 + 2)?
By the standard rules it is 16: the parentheses give 8 ÷ 2 × 4, and then left to right, 8 ÷ 2 = 4 and 4 × 4 = 16. Some people give a multiplication written without a sign priority and get 1. The calculator follows the standard rules and shows a note when your expression has this form; add parentheses, 8 ÷ (2(2 + 2)), if you mean 1.
Is −3² equal to 9 or −9?
It is −9. The exponent applies to 3 only, and the minus sign is taken after: −3² = −(3²) = −9. To square −3, write (−3)² = 9.
How is 2^3^2 worked out?
Stacked exponents are worked from the top down (from the right): 2^3^2 = 2^(3^2) = 2^9 = 512, not (2^3)^2 = 64.
Why is the answer a fraction?
The calculator keeps every step exact. When a division does not come out as a decimal that ends, such as 1 ÷ 3, it keeps the fraction 1/3 instead of rounding, and shows the decimal value next to the answer.
Can I use decimals, negative numbers and brackets?
Yes. Type decimals such as 0.25, negative numbers such as −4 or 5 − (−3), and group with ( ), [ ] or { }. Use * or × to multiply, / or ÷ to divide, and ^ (or **) for exponents.