We study cosmological dynamics of the energy-momentum squared gravity. By adding the squared of the matter field’s energy-momentum tensor (ζ T2) to the Einstein–Hilbert action, we obtain the Einstein’s field equations and study the conservation law.We show that, the presence of ζ T2 term, breaks the conservation of the energy-momentum tensor of the matter fields. However, an effective energy-momentum tensor in this model is conserved in time. By considering the FRW metric as the background, we find the Friedmann equations and by which we explore the cosmological inflation in ζ T2 model. We perform a numerical analysis on the perturbation parameters and compare the results with Planck2018 different data sets at 68% and 95% CL, to obtain some constraints on the coupling parameter ζ .We show that, for 0 < ζ ≤ 2.1×10−5, the ζ T2 gravity is an observationally viable model of inflation.