Consumer confidence in Germany is set to fall in July to an all-time low, as inflation and Russia’s war in Ukraine weigh heavily on household sentiment.

Market research group GfK’s forward-looking consumer sentiment index forecasts confidence declining to minus 27.4 in July from a revised figure of minus 26.2 in June. July’s figure is below the forecast of economists polled by The Wall Street Journal of minus 27.0.

“The ongoing war in Ukraine and disruptions in supply chains are causing energy and food prices in particular to skyrocket, resulting in a gloomier consumer climate than ever before,” GfK consumer expert Rolf Buerkl said. Since the collection of data for the whole of Germany started in 1991, the current value of minus 27.4 is the lowest that has ever been measured.

Above all, the increase in the cost of living is weighing heavily on consumer sentiment and sending it into a downward spiral, Mr. Buerkl said.

GfK uses data from three subindexes from the current month to derive a sentiment figure for the coming month, measuring consumers’ economic expectations, income expectations and propensity to buy.

The three indexes suffered losses in June, according to the survey.

After a brief recovery the previous month, economic expectations have worsened again this month, falling to minus 11.7 in June from minus 9.3 in May.

“Consumers continue to see a significant risk of the German economy slipping into recession,” the report said.

Income expectations are continuing their rapid descent in June, falling to minus 33.5 from minus 23.7 in May. This is the lowest value in almost 20 years, GfK said.

In the wake of falling economic and income expectations, the propensity to buy has also declined, with the indicator dropping to minus 13.7 in June from minus 11.1 in May. The diminishing purchasing power resulting from inflation is having an increasing negative impact on the propensity to consume, the report said.

Mr. Buerkl said a sustained turnaround in consumer sentiment continues to depend on successful negotiations to end the conflict in Ukraine and a decline in inflation.

Write to Maria Martinez at maria.martinez@wsj.com