The Ifo institute said its business climate index rose to 101.8 from 99.2 in May. A Reuters poll of analysts had pointed to a June reading of 100.6.
"The German economy is shaking off the coronavirus crisis," Ifo President Clemens Fuest said in a statement.
Chancellor Angela Merkel said on Wednesday Germany was on the verge of a strong economic upswing, adding that Bundesbank chief Jens Weidmann had given a very positive assessment of the economic outlook to the cabinet.
Germany's central bank raised its growth forecasts earlier this month and now expects the economy to reach pre-pandemic levels as soon as next quarter and grow by 3.7% this year and 5.2% next year.
German authorities have loosened COVID-19 restrictions in light of falling infections and higher vaccination numbers.
The bounce-back from lockdown is driving the largest upward leap in retail conditions seen since German reunification more than three decades ago, Ifo economist Klaus Wohlrabe said.
Despite concerns about supply bottlenecks, Volkswagen said on Tuesday a global chip shortage that is hitting carmakers will not impact its forecasts for 2021 operating profit margins.
"Fortunately, been we have able to notably limit the negative impact on our customers and thus on delivery figures so far, for example by selling off inventories and other measures," a spokesperson for the company said.
Ifo's Wohlrabe said the economy would grow by 1.3% in the second quarter, and by a further 3.6% in the following quarter, with bottlenecks and rising input costs pushing many companies to raise prices.
Even in hospitality, among the sectors worst-hit by lockdown, where conditions were still bad, there was growing optimism, he added.
Thomas Gitzel, economist at VP Bank Group, said the economy is "currently in excellent shape".
"However, the pandemic is still not completely eliminated as an economic stumbling block. The Delta variant worries not only virologists but also economists," he added.
The share of COVID-19 infections caused by the more easily transmitted Delta variant of the coronavirus has doubled in Germany in a week and is likely to gain more traction over other variants, the Robert Koch Institute public health agency said on Wednesday.
(Writing by Paul CarrelEditing by Caroline Copley and Toby Chopra)
By Paul Carrel