What is the PEMDAS Order of Operations Solver?
This calculator evaluates any arithmetic expression you type, applying the universal mathematical order of operations known by many acronyms: PEMDAS (Parentheses, Exponents, Multiplication/Division, Addition/Subtraction), BEDMAS, BODMAS, GEMDAS and MDAS. It supports addition, subtraction, multiplication, division, exponents, roots, negative numbers, decimals and any depth of nested brackets. This is a universal math tool, valid everywhere.
How to use it
Type a single expression using numbers and the operators + - * / ^ r . ( ) [ ] { }. Brackets of any type behave identically. Use ^ for exponents (2^5 = 32) and r for roots (2r3 is the cube root of 2). Adjacent grouped factors mean multiplication: (10+5^2)((5*-2)+9) multiplies the two groups, and 3(4) = 12. Pasted symbols like the division sign, multiplication cross and one-half glyph are cleaned up automatically.
The order of operations explained
Operations are resolved highest precedence first: (1) innermost parentheses, (2) exponents and roots (right-associative, so a^b^c = a^(b^c)), (3) multiplication and division left-to-right, (4) addition and subtraction left-to-right. A root a r b equals a^(1/b), so 5r(1/4) = 5^4.
$$\text{Answer} = \operatorname{eval}\Big(\text{Expression}\Big)\;\xleftarrow{\;\text{PEMDAS}\;}\; \underbrace{(\,)}_{\text{P}}\;\rightarrow\;\underbrace{x^{n}}_{\text{E}}\;\rightarrow\;\underbrace{\times\;\div}_{\text{MD}}\;\rightarrow\;\underbrace{+\;-}_{\text{AS}}$$
Worked example
Input (10+5^2)((5*(-2))+9-3^3)/2. First \(5^2=25\) and \(3^3=27\), then \(10+25=35\) and \((5\times-2)+9-27 = -10+9-27 = -28\), giving $$35\times-28/2 = -980/2 = -490.$$ The answer is -490.
FAQ
Why does 4/1/2 equal 2, not 8? Division is left-to-right, so it reads as (4/1)/2 = 2. To divide by one-half, write 4/(1/2) = 8.
How do I write a fractional exponent? Parenthesize it: 5^(2/3). Without parentheses, 5^2/3 is (5^2)/3 because division has lower precedence than the exponent.
What about division by zero? The solver returns an error instead of infinity, and likewise flags 0th roots and negative bases with non-integer powers.