Contact Riemannian geometry is used to study equilibrium thermodynamical systems as embedded submanifolds of the thermodynamical phase space. A metric compatible with the contact structure is chosen and proved to be invariant under Legendre transformations. With this metric structure all curvature information is contained in the second fundamental form, since every equilibrium thermodynamical system has constant torsion equal to 1/2. Defining contact Hamiltonian vector fields, analogue to the symplectic ones, we find a group of contact metric automorphisms which allows to classify distinguishable thermodynamical systems.