The result was in line with a forecast of analysts polled by Dow Jones Newswires for Europe's biggest economy.
On a monthly basis, German inflation came in at 0.4 percent, higher than the analyst's forecast for no change.
That was mainly as a result of marked increases in the cost of heating oil and motor fuels, the national statistics office Destatis said.
Final figures are expected on July 9.
In May, inflation in Germany and the 16-nation euro-zone in general was zero, as the bloc flirted with deflation, a generalised decrease in prices that can undermine investment, production and jobs.
The European Central Bank does not consider such a possibility to be a serious threat.
Prices have plunged mainly because of a sharp drop late last year in the cost of crude oil, which spiked in July 2008 to all-time highs, and which has begun to climb again.
Destatis said that motor fuels gained between 3.9 and 5.1 percent in June from May, while heating oil was up by between 5.1 and 8.6 percent.
“After already moderate monthly rises in the energy price component of the consumer price index in the previous two months, gasoline and heating oil prices were up strongly in June,” UniCredit economist Alexander Koch noted.
Food prices also rose, for the first time since January on a monthly basis, gaining between 0.1 and 0.5 percent, Destatis said.
“The strong disinflation process in consumer prices since mid last year is levelling off,” Koch commented.
“Depending mainly on the volatility in the oil price we expect a fluctuation around the zero mark in the short term,” he said.