We establish a Gröbner-Shirshov bases theory for trialgebras and show that every ideal of a free trialgebra has a unique reduced Gröbner-Shirshov basis. As applications, we give a method for the construction of normal forms of elements of an arbitrary trisemigroup, in particular, A.V. Zhuchok’s (2019) normal forms of the free commutative trisemigroups are rediscovered and some normal forms of the free abelian trisemigroups are first constructed. Moreover, the Gelfand-Kirillov dimension of finitely generated free commutative trialgebra and free abelian trialgebra are calculated respectively.