Aims. We report the discovery as well as the orbital and physical characterizations of two new transiting giant exoplanets, CoRoT-30 b and CoRoT-31 b, with the CoRoT space telescope. Methods. We analyzed two complementary data sets: photometric transit light curves measured by CoRoT, and radial velocity curves measured by the HARPS spectrometer. To derive the absolute masses and radii of the planets, we modeled the stars from available magnitudes and spectra. Results. We find that CoRoT-30 b is a warm Jupiter on a close-to-circular 9.06-day orbit around a G3V star with a semi-major axis of about 0.08 AU. It has a radius of 1.01 ± 0.08 RJ, a mass of 2.90 ± 0.22 MJ, and therefore a mean density of 3.45 ± 0.65 g cm−3. The hot Jupiter CoRoT-31 b is on a close-to-circular 4.63-day orbit around a G2 IV star with a semi-major axis of about 0.05 AU. It has a radius of 1.46 ± 0.30 RJ, a mass of 0.84 ± 0.34 MJ, and therefore a mean density of 0.33 ± 0.18 g cm−3. Conclusions. Neither system seems to support the claim that stars hosting planets are more depleted in lithium. The radii of both planets are close to that of Jupiter, but they differ in mass; CoRoT-30 b is ten times denser than CoRoT-31 b. The core of CoRoT-30 b would weigh between 15 and 75 Earth masses, whereas relatively weak constraints favor no core for CoRoT-31 b. In terms of evolution, the characteristics of CoRoT-31 b appear to be compatible with the high-eccentricity migration scenario, which is not the case for CoRoT-30 b. The angular momentum of CoRoT-31 b is currently too low for the planet to evolve toward synchronization of its orbital revolution with stellar rotation, and the planet will slowly spiral-in while its host star becomes a red giant. CoRoT-30 b is not synchronized either: it looses angular momentum owing to stellar winds and is expected reach steady state in about 2 Gyr. CoRoT-30 and 31, as a pair, are a truly remarkable example of diversity in systems with hot Jupiters.