Falls in clothing and food prices were the main contributors to the change in the rate, the Office for National Statistics (ONS) said.
The ONS said the rate was also affected by a smaller rise in air fares in June than a year ago.
Bank of England governor Mark Carney has said he expects inflation to remain low in the immediate short term.
But the Bank expects it to start picking up around the turn of the year.
The rate of Retail Price Index (RPI) inflation - which includes housing costs such as mortgage interest payments and council tax - was 1% in June, unchanged from May.
"Inflation has continued its pattern of recent months, when prices have been very little changed on the previous year," said Philip Gooding from the ONS.
"The headline rate for June has dropped very slightly on May, back to zero, thanks to small downwards effects from movements in clothing and food prices and air fares."
The CPI rate has been hovering around zero since February, and moved into negative territory in April for the first time on record, dropping to -0.1%.
Howard Archer, chief UK economist at Global Insight, said the latest figure was good news for consumers.
"With earnings growth currently seeing clear improvement and employment high and rising, purchasing power is currently in rude heath," he added.
While flat or low inflation can be good news for consumers, a prolonged period of negative inflation is generally perceived as harmful to an economy. The fear is that people will defer spending in the hope that goods or services will become cheaper later.
The current inflation figure is well below the Bank of England's target of around 2%.
Core inflation, which excludes energy, food, alcohol and tobacco prices, fell last month to 0.8%. That was down from 0.9% and the joint-lowest rate since 2001.
"The data therefore raise questions over the whether underlying price pressures are really picking up to the extent than the Bank of England is anticipating," said Chris Williamson, chief UK economist at Markit.
He said that attention would now turn to Wednesday's wage growth data,
"The Bank of England needs to determine whether pay growth will continue to accelerate as firms compete for staff, or whether low inflation will keep the overall rate of increase below levels that would normally worry the monetary policy committee into hiking interest rates," he added.

Hansen has made six changes as New Zealand play for the first time since beating Australia 34-17 in the World Cup final.
Wales have not beaten the Kiwis in more than 62 years, a fact Hansen believes provides extra motivation.
"They are desperate to re-write some history so that makes them a really dangerous beast I think," Hansen said.
The Welsh run of 26 consecutive defeats against New Zealand includes three when Hansen was Wales coach between 2002 and 2004.
He added: "They see us as the team they want to beat and you know there's enough history been written about how long it's been - and it's going to happen one day.
"This is a really good Welsh side and it could happen this weekend if we don't turn up and play as well as we can."
Wales were outscored by five tries to one in a 27-13 defeat by England the last time they played, and coach Warren Gatland has made five changes from that match.
But Hansen believes the result was a reflection of Wales' lack of match-fitness rather than the quality of their performance.
He also thinks Wales are adapting their game to match the greater speed of matches in the southern hemisphere.
Media playback is not supported on this device
"The northern hemisphere are starting to realise they have to change their game and we saw that against England," said Hansen.
"They hadn't played for some time ahead of that game and for the first 30-40 minutes against England they played really well.
"They fell away a little bit due to lack of game time in the second half so they have changed their game a little bit."
The rate of UK Consumer Prices Index inflation fell to 0% in June, from 0.1% in May, official figures show.
[NEXT_CONCEPT]
All Blacks coach Steve Hansen says Wales are a "dangerous beast" ahead of Saturday's first test in Auckland.