The closely-watched Ifo business confidence index set a new record of 115.1 points, defying expectations of analysts of a slight decline after it reached 114.6 in May, the highest since 1991.
The Munich-based Ifo Institute for Economic Research calculates the score from a survey of 7,000 companies, who are asked to give their assessments of the current business situation and their expectations for the next six months.
Analysts surveyed by financial services provider Factset had expected 114.4 points in June.
The strong optimism comes despite challenges for Europe's top exporters, from US President Donald Trump's "America First" stance on trade to Britain's looming exit from the European Union.
"Sentiment among German businesses is jubilant," said Ifo president Clemens Fuest in a statement.
"Companies were significantly more satisfied with their current business situation this month. They also expect business to improve."
The German economy expanded by 0.6 percent in the first quarter, and the government expects growth to hit 1.5 percent for the full year, while several economists have predicted it would reach or top last year's level of 1.8 percent.
Fuest said that "Germany's economy is performing very strongly. In manufacturing, the index rose slightly. Assessments of the current business situation remained unchanged at a very high level."
The optimism was shared by manufacturers -- who planned to ramp up production -- wholesalers and retailers, Ifo said, pointing to a lower index only in construction where the assessments of current and future business nevertheless remained at a high level.