Staff at Cefn Hengoed comprehensive in east Swansea say the pupils took explicit photographs using webcams in their homes before circulating the pictures.
Now letters are being sent to families of all 730 pupils advising parents against giving children computers in their bedrooms, amid fears they are exposing themselves to paedophiles.
In the first incident, three months ago, a 14-year-old girl took naked pictures of herself and transmitted them to friends via an instant messaging service.
Earlier this month a 13-year-old girl sent photos of herself in underwear with handcuffs and a whip to an internet profile site, set up to allow adults to meet each other on-line.
Staff say the photos came to light when the 13-year-old rowed with friends over her actions, leading to a scuffle on the school grounds. The school has decided to publicise the incidents to warn other schools and families of potential dangers. Geoff Brookes, deputy head, said: "The girls were clever enough to do it but not to work out what it meant for their image and how it could be abused. We have an obligation to protect children who do these things really very innocently - that is far more important than worrying about the reputation of our school."
The school contacted its police community liaison officer and is scheduling separate teaching sessions for boys and girls to warn them of the dangers of using the internet.
A letter will be posted to parents advising them to monitor internet usage, the websites visited, and people contacted.
Heather Cooper, assistant head, said one girl did it for a dare, while the other initially called it "a bit of fun".
Anna Brychan, director of the National Association of Head Teachers Cymru, said: "Pupils are skilled at using technology but may not appreciate its impact.
"These are the kinds of experimentations that pupils have always done but these days they can have far greater exposure at just the click of a button."