Her death would be the 13th this year to have been caused by the drug, taken by an estimated 500,000 people every weekend.
Julia Dawes is thought to have taken the two tablets in a Perth nightclub on Saturday night as she celebrated a friend's birthday.
She died yesterday at Perth Royal Infirmary, where she had been in intensive care since Sunday after collapsing at her home on the outskirts of the town.
Government figures estimate an average of 12 people a year die after taking ecstasy, though other estimates have put the figure as high as 30 deaths this year alone.
A spokesman for the Department of Health said: "There are a number of possible causes of deaths from ecstasy - people do not know what is in it, they don't know what they are taking; they may have a strong reaction to it or it is has been shown to cause the brain to swell.
"We simply take the view that no drug is a safe drug. You cannot predict what will happen.
"There is some research but it is a fairly new phenomenon. No one knows what the long-term effects are."
Anti-drug campaigners expressed their sympathy for the dead girl's family after news that her life support machine had been turned off yesterday.
Paul Betts, whose daughter Leah died after taking ecstasy at her 18th birthday party in 1991, said his heart went out to the family.
"The story continues and yet another beautiful life has been wasted tragically because of drugs," he said.
Ms Dawes' parents, Alan and Jacqueline, and her brother, Jonathan, were said to be "deeply grieved" by her death.
Perth and Kinross Healthcare NHS Trust issued a statement on their behalf.
It said: "They wish time to be alone as a family to come to terms with the loss of Julia.
"Mr Dawes would like to say that they have experienced a breadth and depth of human compassion from doctors, nurses and ambulance services, more than they could have wished for, and an experience of loving care that will endure in their memories for ever."
MP for Perth Roseanna Cunningham said: "This just goes to show that nowhere and no one is safe from the menace of drugs.
"We need more education of our children to explain to them the damage that drugs can do."Reuse content