The consumer sentiment indicator published by the Nuremberg-based GfK institute and based on a survey of around 2,000 Germans rose to 10.4 going into June, the highest reading since October 2001.
A Reuters poll had expected an unchanged reading of 10.2.
GfK linked the high reading to expectations the economy will continue to grow in the face of global risks like possible protectionist policies in the United States and tough Brexit negotiations between Britain and the European Union.
"In the view of consumers, the engine of the German economy is running increasingly smoothly," GfK researcher Rolf Buerkl said in a statement.
"Supported by improving economic forecasts, income expectations also grew. The consistently well-positioned German labour market situation is largely feeding this optimism."
The bright GfK index reading comes on top of both hard data and sentiment indicators in recent weeks that have indicated the German economy is firing on all cylinders.
On Tuesday, the closely watched Ifo business climate index rose to its highest level since its current data set began in 1991, the year after West and East Germany unified.
Final growth figures this week also confirmed that the economy expanded by 0.6 percent in the first quarter, helped by strong exports and increased investments in buildings and equipment as well as solid state and household spending.
GfK said it expects consumption to grow 1.5 percent this year, suggesting domestic demand will again be a crucial pillar of support for the economy. Household spending has been the main driver of overall economic growth in the last two years.
With such solid foundations, risks are likely to come from abroad, GfK said.
"Risks for consumers primarily originate from possible economic (and) political shocks from elsewhere, for example as a result of increasingly protectionist trends in the United States," Buerkl said.
"Should trade barriers or higher duties hinder exports from Germany, it could lead to employees fearing more for their jobs, especially those working at companies relying heavily on ex-ports," he added.
"The result would be greater reluctance to make purchases."
(Reporting by Joseph Nasr; Editing by Catherine Evans)