The five were looking for metal in an old army barracks, a military spokesman told the BBC.
The BBC's James Copnall says unexploded ordnance and mines remain a big problem in South Sudan, following decades of civil war.
There are clear-up operations under way in several areas of South Sudan, but such explosions kill people every year.
The children, aged 10-14, were killed in a former barracks in Juba's Souk Sita district, army spokesman Col Philip Aguer said.
He said that a Ugandan man who was with them, presumably to buy the scrap metal, was wounded.
South Sudan gained independence in 2011 after a long conflict with the north but it remains one of the world's least developed countries.
In addition to the explosives left over from the war, rebels have been accused of laying new mines, particularly in Unity state near the border with Sudan, our correspondent reports.
This has at times made travel around the area dangerous, he adds.
Five children have been killed by an old mortar shell as they dug for scrap metal in South Sudan's capital, Juba.