mXparser - Math Expression Evaluator / Parser - Library Description

mXparser - logo

mXparser is a super easy, rich, fast and highly flexible math expression parser library (parser and evaluator of mathematical expressions / formulas provided as plain text / string). Software delivers easy to use API for JAVA, Android and C# .NET/MONO (Common Language Specification compliant: F#, Visual Basic, C++/CLI). Expression parser comes with extensive documentation, easy to follow tutorial, "Hello World!" projects for 5 different languages explained with many screenshots, and finally - last, but not least - performance test summary. Formula evaluator is distributed under "Simplified BSD license", which means software is completely free 🙂

mXparser - Supported frameworks

Feb 17, 2018 - celebrating 30000 downloads!


mXparser - deomo

C# Demo

mXparser - deomo - C#

*** If you found the software useful donation is something you might consider 🙂 ***

If you found the software useful donation is something you might consider :-)

!!! mXparser - v.4.0.0 released on 2017-03-27: Major update: Bitwise Operators, Numbers in scientific notation, Units, Physical & Astronomical Constants, Equations solving via finding function root, Better tokens handling, Function Extensions - possibility of using your own implementation, Bugs fixed. !!!

Please check it out – my new project - Janet Sudoku - a powerful and flexible Sudoku Generator and Sudoku Solver library for Java, Android, .NET, MONO.

Janet Sudoku

Few examples of string equivalent to the math formula notation:




=  "int( sqrt(1-x^2), x, -1, 1)"

= "sum(n, 1, 100, 1/n^2)"

= "C(n,k)"

"fib(n) = iff( n>1, fib(n-1)+fib(n-2); n=1, 1; n=0, 0)"

Math expressions parser - supported frameworks:

    • JAVA: 1.5, 1.6, 1.7, 1.8 (separate binaries available if necessary)
    • Android: tested with mxparser_jdk1.7.jar
    • .NET/MONO: 2.0, 3.0, 3.5, 4.0, 4.5, 4.6 (separate binaries available if necessary)
    • .NET Core: 1.0, 1.1
    • .NET Standard: 1.0, 1.6
    • .NET PCL: portable45, win8, wpa81
    • Xamarin.Android: 1.0, 6.0
    • Xamarin.iOS: 1.0


Did you find the software useful? Please consider donation 🙂
Developing and maintaining takes a lot of time, mainly my free time. I hope it saved some of your time. If yes, then buy me a coffee 🙂


Download latest release – v.4.2.0 Aquaria: bin + doc + src (.zip 15.5 MB)

Download latest release – v.4.2.0 Aquaria: bin only (.zip 5.99 MB) – separate binaries for java: 1.6, 1.7, 1.8; .NET: 2.0, 3.0, 3.5, 4.0, 4.5, 4.6, 4.7, .NET Core, .NET Standard, .NET PCL, Xamarin.Android, Xamarin.iOS

Source code .zipSource code .tar.gz View on

Math Expressions Parser Features:

      • rich built-in library of operators, constants, math functions;
      • user defined: arguments, functions, recursive functions and general recursion (direct / indirect);
      • grammar and internal syntax checking;

Math Expressions Parser - features list with examples

Functionality Example Support level
Simple calculator i.e.: 2+3, n! Full support
Binary relations i.e.: a*b Full support
Boolean operators i.e.: a&b Full support
Built-in constants i.e.: 2+pi Full support
User defined constants i.e.: 3tau, where tau = 2pi Full support
Built-in unary functions i.e.: sin(2) Extensive collection
Built-in binary functions i.e.: log(a,b) Main functions
Built-in n-arguments functions i.e.: gcd(a,b,c,d,…) Special functions
Evaluating conditions i.e.: if(a=true, then b, else c) Full support
Cases functions i.e.: iff(case1, then a1, case2, then a2, ...) Full support
User defined arguments i.e.: x = 5, cos(x) Full support
User defined dependent arguments i.e.: x=2, y=x^2 Full support
Iterated operators - SIGMA summation i.e.: sum( 1, n, f(…,i) {step} ) Full support
Iterated operators - PI product i.e.: prod( 1, n, f(…,i) {step} ) Full support
Derivatives i.e.: der( sin(x), x) ) Full support
Integrals i.e.: 2*int( sqrt(1-x^2), x, -1, 1) Full support
User defined functions i.e.: f(x,y) = sin(x+y) Full support
Fast (limited) recursion i.e.: fib(n) = fib(n-1) + fib(n-2), addBaseCase(0, 0), addBaseCase(1, 1) Full support
Recursion, any kind i.e.: Cnk(n,k) = if( k>0, if( k<n, Cnk(n-1,k-1)+Cnk(n-1,k), 1), 1) Full support
Syntax checking checkSyntax() Full support
Getting computing time getComputingTime() Full support
Verbose mode setVerboseMode() Full support

mXparser - deliverables

Language / Framework Documentation Library Source code
JAVA Yes Yes Yes
Android Yes Yes Yes
C# .NET Yes Yes Yes
Visual Basic .NET(CLS) Yes Yes
C++/CLI .NET(CLS) Yes Yes
F# .NET(CLS) Yes Yes
Other .NET languages Yes Yes, not tested
MONO Yes Yes, dll tested C# code

Math Expression Parser - Main functionalities:

Math ExpressionParser - High flexibility functionalities

Math Expression Parser - Project documentation

- mXparser - API documentation

- mXparser - a very easy Tutorial

- - site about math with mXparser examples (polish)

mXparser - GitHub

mXparser - SourceForge

*** If you found the software useful donation is something you might consider 🙂 ***

If you found the software useful donation is something you might consider :-)

Enjoy 🙂

Best regards,

Mariusz Gromada