Abstract In this paper, the maximal abelian dimension is algorithmically and computationally studied for the Lie algebra hn, of n×n upper-triangular matrices. More concretely, we define an algorithm to compute abelian subalgebras of hn besides programming its implementation with the symbolic computation package MAPLE. The algorithm returns a maximal abelian subalgebra of hn and, hence, its maximal abelian dimension. The order n of the matrices hn is the unique input needed to obtain these subalgebras. Finally, a computational study of the algorithm is presented and we explain and comment some suggestions and comments related to how it works.