Infinitesimal bialgebras were introduced by Joni and Rota. An infinitesimal bialgebra is at the same time an algebra and coalgebra, in such a way that the comultiplication is a derivation. Twenty years after Joni and Rota, Aguiar introduced the concept of an infinitesimal (non-unitary) Hopf algebra. In this paper, we study infinitesimal unitary bialgebras and infinitesimal unitary Hopf algebras, in contrary to Aguiar’s approach. Using an infinitesimal version of the Hochschild 1-cocycle condition, we prove, respectively, that a class of decorated planar rooted forests is the free cocycle infinitesimal unitary bialgebra and free cocycle infinitesimal unitary Hopf algebra on a set. As an application, we obtain that the planar rooted forests are the free cocycle infinitesimal unitary Hopf algebra on the empty set.