"Wonder Woman," "Moana" and "Trolls" were among a slew of global box-office hits that featured women protagonists — and they're part of a larger trend.

The top-grossing movies from 2014 to 2017 with women leads out-earned movies starring men across all budget levels, according to an analysis from the Creative Artists Agency and shift7, a company started by the former U.S. chief technology officer Megan Smith.

The research also found that films that passed the Bechdel test — a gender bias test that measures whether at least two female characters converse about something other than a man — earned more than films that failed it. Since 2012, all movies that made over $1 billion in revenue pass the Bechdel test.

Of the 350 films included in the study's dataset, 105 were female-led and 245 were male-led. The data was broken down by budget size, in categories with films made for less than $10 million, $10 million to $30 million, $30 million to $50 million, $50 million to $100 million, as well as films made for more than $100 million.

"There's a lot of conventional wisdom that woman led films make less money. But our data doesn't support that," Smith tells CNBC Make It.

In each bracket, average earnings for female-led movies surpassed male-led movies. A separate analysis using medians instead of average earnings, which reduces outliers, showed the same results with one exception: In the $30 million to $50 million category, the median take for male-led films was $104 million, and for women it was $102 million.

The financial success of women-led films is significant, considering that women accounted for only a quarter of the solo protagonist roles in the top films of 2017 and only played around a third of the major characters. Additionally, the number of female protagonists with speaking roles in top films actually dropped in 2017 compared to the previous year.

The new research also comes during a period of heightened scrutiny of diversity and inclusion in Hollywood, in the wake of movements like #OscarsSoWhite and #MeToo, which have called for greater representation for women and minorities onscreen.

"Hollywood is leaving billions on the table, because they aren't making films that are diverse in terms of gender, on and off camera. Research shows that films that look like America, in race and ethnicity, do best at the box office," Darnell Hunt, a UCLA sociology professor and the co-author of the annual Hollywood diversity report, tells CNBC Make It. "Viewers want to see stories and characters that resonate with their experiences."

C.A.A and shift7 collaborated with TIME'S UP, the organization that grew out of a movement to fight sexual harassment in entertainment and workplaces across industries. The study is part of an effort to pressure Hollywood into including more women and people of color onscreen and behind the scenes, with proponents arguing that greater diversity improves the bottom line.

Some of the films included in the study were Anna Kendrick-led "Trolls," the Megan Fox-led "Teenage Mutant Ninja Turtles," "Inside Out," "Moana," and international blockbuster "Wonder Woman." Other popular female-led films in the last year included Academy Award nominees "Lady Bird" and "I, Tonya," as well as the live-action re-imagining of "Beauty and the Beast."

"We have to find the economic opportunity in motion pictures, and consistently we see over performance by films that have ethnic diversity and female protagonists," C.A.A. agent Christy Haubegger tells CNBC Make It. "There are under-served audiences that respond enthusiastically to characters they can relate to."

Like this story? Subscribe to CNBC Make It on YouTube!

Don't miss:

A historic number of women were elected in 2018—these four are expected to run for president in 2020

A new study suggests women earn about half what men earn