The children, in their mid teens and from St Albans, Hertfordshire, got lost around Llyn y Fan Fach, near Abercraf.
Andrew Evans of Western Beacons Mountain Rescue Team said a rescue helicopter located the missing groups and every child has either made their way off the mountain or are on their way down.
They have been taken to hospital for a precautionary check-up.
The alarm was raised at about 13:00 BST after the groups got lost in clouds while doing their Duke of Edinburgh Award.
A Dyfed-Powys Police spokesman said: "We are pleased to confirm that following the search and rescue operation on the Brecon Beacons this afternoon, all 26 members of the party involved have been accounted for."
The Welsh Ambulance Service said: "26 patients were taken to Ystradgynlais Community Hospital for a precautionary check-up. None of their injuries are believed to be serious."
Mark Moran from Central Beacons Mountain Rescue said his team had been in intermittent phone contact with the four groups before the first group was found.
Twelve rescuers from Western Beacons, Central Beacons and Brecon mountain rescue teams were involved in the search.
Mr Evans added: "This kind of thing does happen from time to time with groups doing their group Duke of Edinburgh."
Rescuers have found all 26 children who went missing in the Brecon Beacons.