A powder X-ray diffraction study, combined with magnetic susceptibility and electric transport measurements, was performed on a series of LnCoO(3) perovskites (Ln = Y, Dy, Gd, Sm, Nd, Pr and La) over a temperature range 100-1000 K. A non-standard temperature dependence of the observed thermal expansion was modelled as a sum of three contributions: (1) weighted sum of lattice expansions of the cobaltite in the diamagnetic low spin state and in the intermediate (IS) or high (HS) spin state. (2) An anomalous expansion due to the increasing population of excited (IS or HS) states of Co3+ ions over the course of the diamagnetic- paramagnetic transition. (3) An anomalous expansion due to excitations of Co3+ ions to another paramagnetic state accompanied by an insulator-metal transition. The anomalous expansion is governed by parameters that are found to vary linearly with the Ln ionic radius. In the case of the first magnetic transition it is the energy splitting E between the ground low spin state and the excited state, presumably the intermediate spin state. The energy splitting E, determined by a fit to magnetic susceptibility, decreases with temperature. The values of E determined for LaCoO3 and YCoO3 at T=0 K are 164 K and 2875 K respectively, which fall to zero at T=230 K for LaCoO3 and 860 K for YCoO3. The second anomalous expansion connected with a simultaneous magnetic and insulator-metal transition is characterized by its center at T=535 K for LaCoO3 and 800 K for YCoO3. The change of the unit cell volume during each transition is independent of the Ln cation and is about 1% in both cases.