Watching musical theater is as good for you as half an hour’s exercise, a study says.

Scientists monitored an audience at a “Dreamgirls” show.

Heart rates doubled as the drama and songs intensified, peaking before the interval and finale.

In all, heart rates of the 12 seated volunteers were raised to between 50 and 70 percent of their theoretical maximum for 28 minutes.

The British Heart Foundation says these levels are “optimal” for stimulating cardio fitness and boosting stamina.

Dr. Joseph Devlin, of University College London, said such activity was equal “to an exerting cardio workout.”

“Dreamgirls,” which is currently showing in London’s West End, is based on the showbiz aspirations and successes of R&B acts such as The Supremes, James Brown and Jackie Wilson.

The award-winning show, written by Tom Eyen, follows the story of a young female singing trio named The Dreams, who become musical superstars.

An accompanying poll of 2,000 adults found the thing they enjoy most about the theater is the emotion and feeling of goose-bumps.

The same number has gasped or jumped in shock during a show but only one in seven has noticed a change in their breathing — whether faster or slower.

The research was undertaken by the University College London alongside Encore Tickets.