Oil prices were up compared to the same period last year, but the cost of many vegetables plunged because of a nationwide scare over an E. coli bacteria outbreak that has claimed at least 47 lives, according to the provisional figures.
In the western state of Baden-Württemberg, one of six regions which provide data for the initial inflation estimate, the prices of lettuce, tomatoes and cucumbers dropped by more than 20 percent in June.
The government warned consumers about eating these vegetables before determining that the outbreak had most likely been caused by sprouts grown on a farm in northern Germany.
The inflation figure is unlikely to deter the European Central Bank (ECB) from hiking rates in July.
"The ECB cannot base its monetary policy simply on Germany's prosperous economy" but must take account of other eurozone countries in financial difficulty, the bank said in a statement last week.
Andreas Rees, an economist at Unicredit bank, also sees "inflation raising its ugly head" again soon as firms pass on to customers the cost of higher raw materials.
In May, the cost of imports into Germany climbed by 8.1 percent over the year in part because of higher metal prices, according to official data also released on Tuesday.