In this note, we provide an algorithm that, starting with a Sullivan algebra gives us its minimal model. More concretely, taking as input a (nonminimal) Sullivan algebra A with an ordered finite set of generators preserving the filtration defined on A, we obtain as output a minimal Sullivan algebra with the same rational cohomology as A.This algorithm is a kind of modified AT-model algorithm used, in the past, to compute a chain contraction providing other kinds of topological information such as (co)homology, cup products on cohomology and persistent homology.