# mXparser: one expression evaluator across Java, C#, C++, Kotlin and .NET

> mXparser evaluates mathematical expressions given as plain text, and the same library ships for Java, Kotlin, Android, C++ and the .NET family with one built in function set. Its recent releases have been about operators, thread safety and documentation tooling rather than new runtimes.

**mariuszgromada/MathParser.org-mXparser** — Math Parser: Java, C#, C++, Kotlin, Android, and all .NET platforms (Nuget, Maven, CMake). Supports .NET Framework, .NET Core, .NET Standard, Xamarin, and more. Features: rich built-in library of math functions, operators, constants. Flexible in user-defined arguments, functions.  Expressions provided as plain text. Easy to use. Well documented.

- Repository: https://github.com/mariuszgromada/MathParser.org-mXparser
- Website: https://mathparser.org/
- Stars: 955 · Forks: 157
- Language: C++
- License: NOASSERTION
- Published: 2026-10-20 · Updated: 2026-10-20 · Language: en
- Canonical page: https://hysenlabs.com/projects/mariuszgromada-mathparser-org-mxparser

## Plain text in, a number out, across five stacks

mXparser is a mathematical expression parser, or expression evaluator, whose input is an expression written as plain text. The project describes it as easy to use and well documented, with a rich built in library of maths functions, operators and constants, and flexibility in user defined arguments and functions.

That combination is what makes it worth a look. A formula field in a business application, a rule engine for an industrial system, a calculator inside an Android app, a configuration value in a .NET service: all of them need the same thing, an expression parser with a full function library that behaves the same on every platform. mXparser ships one library for Java, Kotlin, Android, C++ and the .NET family, distributed through NuGet, Maven and CMake, and covering .NET Framework, .NET Core, .NET Standard and Xamarin.

The repository itself is more interesting than a parser's repository usually is. The top level holds a CURRENT/ directory that appears to carry the current version of the sources, a Unicode Math.xlsx spreadsheet alongside the Unicode maths support added in version 5.1, a cloc.txt file with line counts, a CONTRIBUTING.md, an ISSUE_TEMPLATE.md and a .codeclimate.yml configuration. The homepage is mathparser.org, which also hosts the tutorial material the README links to for each feature.

The audience is application developers rather than mathematicians. Nobody is using this to do research; they are using it because a user typed a formula into a text box and the application has to make it mean something.

The licence is the part to check first. GitHub cannot classify the licence on this repository and points to LICENSE.txt, so that file, not the badge, is what governs how you can use it.

## Version 6.1.0 added C++, 6.1.1 fixed recursion and derivatives

The release history shows where the effort has gone, and it is not where you might expect.

Version 6.1.0, dated 2024-10-19, carried two headline items: C++ support and a Chinese translation of the documentation. Adding a language to a parser library is a large mechanical job, because every diagnostic message, every built in constant and every piece of documentation has to exist in the new binding, and the 6.0.0 release before it had already been consumed with translations and operators.

Version 6.1.1, dated 2026-05-17 and named Sagitara, is described as a maintenance release with bug fixes and improvements. Its contents are specific enough to be useful. There is an item about a warm-up before concurrent use, which suggests the thread safety story needed work at the boundary. Two bugs are called out: a function h(x) = h(h(0)) recursion problem, and an n-th derivative bug.

Those two fixes are worth pausing on, because they describe the class of defect a maths parser cannot hide. A recursion problem in a user defined function and a wrong derivative are not cosmetic errors, and a library that publishes them with issue references is behaving better than one that quietly patches them. It also tells you the evaluation model is a full expression engine with calculus support rather than a table lookup of operators.

Version 6.0.0, dated 2024-05-19 and named Picon, added translations for French, German, Italian, Polish, Portuguese and Spanish, together with new operators and new binary targets.

The licence file, LICENSE.txt, is the one that matters here, because the licence is not one GitHub can label, which is unusual enough that reading it is not optional for commercial use.

## Bitwise NAND, NOR and XOR, plus two more division forms

The operator work in 6.0.0 is the clearest sign of how the library is used in practice.

Three bitwise operators were added: NAND, NOR and XOR. Bitwise operations on integers inside a formula language are not something you need for symbolic mathematics, and they are not decorative either. They show up in configuration expressions, in hardware and threshold logic, and in the kind of business rule where a numeric field encodes a flag set.

Two division operators also arrived, and they are more surprising. One is called Central and Eastern Europe, written with a colon, and the other is integer division, also called quotient, written with a backslash. The naming makes sense for a library whose author is Polish and whose documentation ships in Polish, Italian and Portuguese: in much of central and eastern Europe a colon is the conventional division symbol on a calculator keypad, so a parser that serves those users accepts both the colon and the backslash forms alongside the slash.

That is a design decision worth respecting rather than puzzling over. A formula parser is only useful if the people typing formulas recognise the notation, and the alternative, a library that only speaks slash, pushes the regional variation into the calling application.

Version 6.0.0 also added new binaries, .NET8 and jdk20, jdk21 and jdk22, which tells you the deployment matrix is tracked explicitly across the .NET and Java runtimes rather than being assumed to work.

Version 5.1, named Libris, added implied multiplication, so that 2x means 2 times x, Unicode maths symbols, additional probability distributions, a calculation steps register and serialization support.

## Thread safety by cloning, and the calculation steps register

Two of the more interesting capabilities came in the same stretch of releases.

Version 5.2.1, named Orion and dated 2023-02-08, added clones for thread safe operations. The pattern is explicit in the release note: if you need the parser from more than one thread, take a clone and give each thread its own. The 6.1.1 item about a warm-up before concurrent use points at the same area, since a shared parser instance that has not been initialised is exactly where a first concurrent call would go wrong.

For a library that is often used inside a request handler or a UI event, the alternative would be a global singleton with a lock, and this design avoids the contention. The cost is that the caller has to know to clone, and the documentation link in the release notes goes to a usage example specifically for cloning for thread safe operations.

The calculation steps register is the other feature that changes what you can do with the results. Instead of a single number, the parser can expose the intermediate steps of the computation, which is what you need to build a step by step explanation of a formula in a teaching tool, a debugging view in a configuration system, or a trace in a scientific application.

Several 5.2.1 bug fixes were about that register itself, including a fix for commas, parenthesis and missing parts related to user arguments, so the register is a feature that has been actively debugged rather than a rarely used extra.

Version 5.2.1 also delivered a performance improvement for calculations in the loop, standardised descriptions of built in elements and error messages, the ability to define your own translations, and export of the help content in CSV, HTML, Markdown and JSON formats.

## Documentation as a shipped feature

The unusual part of this project is how much of the work has gone into documentation and translation rather than into the parser itself.

The help content is exportable in four formats, CSV, HTML, Markdown and JSON, each with its own usage example linked from the release notes. That is a strange thing for a maths library to do unless the target user is a product team building a formula editor with an autocomplete, where the list of functions and their descriptions has to be available to the front end in a form the front end can consume. The JSON export in particular reads like a machine readable catalogue of the built in library.

Translations are treated the same way. The library ships in English, Chinese, French, German, Italian, Polish, Portuguese and Spanish, and version 5.2.1 added the ability to define your own translations rather than being limited to the ones the maintainer provides. Combined with the error message standardisation in the same release, this is a library that expects to be embedded in applications aimed at people whose first language is not English, and it expects its error messages to be shown to those people.

The documentation lives on mathparser.org, and the README links to a tutorial page for each feature rather than duplicating it. The tutorial index covers topics such as C++ support, implied multiplication, Unicode maths, the calculation steps register, validating a string model, configuring your own translation, the help export formats, and cloning for thread safe operations.

The practical consequence is that evaluating this library is partly a documentation exercise. The feature list in the README is long, but the tutorials are where the detail lives.

## Conclusion

mXparser fits developers who need a formula entered by a user evaluated consistently in Java, Kotlin, C++ or .NET, especially in Android and .NET applications where a runtime specific maths stack would be more work. It does not fit a team that needs symbolic manipulation or exact arithmetic beyond double precision, and it does not fit a project that needs a permissive licence without checking the LICENSE.txt file, since GitHub cannot classify it. Verify first that the target language has a published package, since C++ support only arrived in version 6.1.0, and that the operator set matches your formulas.

## FAQ

### Which languages and platforms does mXparser support?

The library covers Java, Kotlin, Android, C++ and C# .NET, distributed through NuGet, Maven and CMake, and supports .NET Framework, .NET Core, .NET Standard and Xamarin. C++ support was added in version 6.1.0, released on 2024-10-19.

### How do I use mXparser safely from several threads?

Version 5.2.1 added clones for thread safe operations, so a clone per thread is the documented pattern, with a usage example on the cloning for thread safe operations tutorial page. Version 6.1.1 later added a warm-up item for concurrent use.

### What new operators did mXparser add in version 6.0.0?

Version 6.0.0, dated 2024-05-19, added the bitwise NAND, NOR and XOR operators, and two division operators, the Central and Eastern Europe colon form and the integer division backslash form, alongside translations and new .NET8 and jdk20 to jdk22 binaries.

### Can I export the mXparser help content for my own application?

Yes. Version 5.2.1 added export of the help content in CSV, HTML, Markdown and JSON formats, and the same release added the ability to define your own translations of the built in elements and error messages.

## Sources

- [Issues](https://github.com/mariuszgromada/MathParser.org-mXparser/issues)
- [mariuszgromada/MathParser.org-mXparser on GitHub](https://github.com/mariuszgromada/MathParser.org-mXparser)
- [Project website](https://mathparser.org/)
- [README](https://github.com/mariuszgromada/MathParser.org-mXparser/blob/master/README.md)
- [Releases](https://github.com/mariuszgromada/MathParser.org-mXparser/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/mariuszgromada-mathparser-org-mxparser
