[TinyExpr][1] does what you want, and more. > TinyExpr is a very small recursive descent parser and evaluation engine for math expressions. It's handy when you want to add the ability to evaluation math expressions at runtime without adding a bunch of cruft to you project. > > In addition to the standard math operators and precedence, TinyExpr also supports the standard C math functions and runtime binding of variables. You'd just need to save `tinyexpr.h` and `tinyexpr.cpp` next to your Sketch. #include "tinyexpr.h" void setup() { Serial.begin(115200); } void loop() { char term[] = "12 + (2 * 5)"; Serial.println(term); int error; double result = te_interp(term, &error); if (error){ Serial.println("Problem with expression."); } else { Serial.print(" = "); Serial.println(result); } delay(1000); } It outputs: 12 + (2 * 5) = 22.00 TinyExpr knows the order of operations, so `12 + 2 * 5` would also return `22.00`. [1]: https://github.com/codeplea/tinyexpr