Context.The dwarf planet Ceres and the asteroid Vesta have been studied by the Dawn space mission. They are the two heaviest bodies of the main asteroid belt and have different characteristics. Notably, Vesta appears to be dry and inactive with two large basins at its south pole. Ceres is an ice-rich body with signs of cryovolcanic activity.Aims.The aim of this paper is to determine the obliquity variations of Ceres and Vesta and to study their rotational stability.Methods.The orbital and rotational motions have been integrated by symplectic integration. The rotational stability has been studied by integrating secular equations and by computing the diffusion of the precession frequency.Results.The obliquity variations of Ceres over [−20 : 0] Myr are between 2° and 20° and the obliquity variations of Vesta are between 21° and 45°. The two giant impacts suffered by Vesta modified the precession constant and could have put Vesta closer to the resonance with the orbital frequency 2s6−sV. Given the uncertainty on the polar moment of inertia, the present Vesta could be in this resonance where the obliquity variations can vary between 17° and 48°.Conclusions.Although Ceres and Vesta have precession frequencies close to the secular orbital frequencies of the inner planets, their long-term rotations are relatively stable. The perturbations of Jupiter and Saturn dominate the secular orbital dynamics of Ceres and Vesta and the perturbations of the inner planets are much weaker. The secular resonances with the inner planets also have smaller widths and do not overlap, contrary to the case of the inner planets.