Expression Evaluator for Java

Expr4j is a simple Java library to evaluate mathematical expressions. The entire library is written in core Java without any external dependencies.

The expressions are evaluated using Dijkstra's Shunting Yard algorithm. Multiple robust implementations of the algorithm are provided and you can choose which implementation to use depending on your preference.


Expr4j is rigorously tested with a large number of unit test cases to ensure quality and stability.

Also if you come across any bugs, you can raise an issue on Github.


The Expr4j API is well documented in standard Java Doc format.

You can explore the API documentation to obtain information about classes and methods.

Open Source

Expr4j is an open source library licensed under Apache License, Version 2.

This gives you the freedom to use Expr4j in commercial and non-commercial applications.

Download the latest release of Expr4j
You can download from Maven Central or Github

started is

Getting started is simple

Getting started is as simple as downloading the latest version of the library, adding it to your project, and then taking a look at the quick start guide.

If you do get stuck though, take a look at the API Documentation for detailed information about the classes and methods.