PARIS — Cavernous factories devoid of workers. Cranes frozen in midair over construction sites. Millions of people confined to their homes, spending a fraction of what they used to before the coronavirus hit.

Europe’s pandemic-induced lockdowns were widely expected to throw the continent into a deep recession. On Wednesday, Germany and France, the largest economies, showed just how bad it’s about to get, warning that they were headed toward their sharpest downturns since World War II.

France officially slid into a recession after suffering one of the worst quarterly contractions in more than 50 years. Growth tumbled an estimated 6 percent from January to April, from the fourth quarter, when the economy shrank slightly because of nationwide strikes, the central bank said. For every two weeks the population remains under confinement, the economy shrinks by at least 1.5 percent, it added.

And Germany is sliding toward its deepest recession on record, with growth expected to plunge almost 10 percent from April through June, five leading economic institutes said Tuesday.