Women in command of America’s biggest businesses are reaping rich rewards.

In an unusual reversal of the gender pay gap, female chief executives at some of the largest U.S. companies repeatedly outearn their male counterparts. Last year, 21 female CEOs received a median compensation package of $13.8 million, compared with the $11.6 million median for 382 male chiefs, according to a Wall Street Journal analysis of S&P 500 leaders who held the job a full year.

Women in the corner offices of the biggest U.S. firms made more money than men in six of the last seven years, though the gap has narrowed since 2014. The trend reflects several factors including strong performances at major businesses run by women during recent years, plus the fact that several female CEOs are pursuing tough turnarounds, which boards typically reward.

Another key factor: few women rise to the top of the corporate ladder. Those doing so tend to be superstars who overcome many obstacles before they run an S&P 500 company, according to executive pay and leadership specialists. Boards in search of diversity and high performers are more willing to pay a premium for a successful female CEO, the experts said.

“Boards don’t want to shortchange their female CEO in today’s environment, when pay equality is such an issue,’’ said Robin Ferracone, head of Farient Advisors LLC, which advises board compensation committees.

Click to see who were the highest (and lowest) paid CEOs, as well as comparisons of shareholder returns and pay by industry.

The total number of women running S&P 500 companies held steady from the previous year’s analysis at 28, including seven women who retired or held the job less than a year, and remains at roughly 5% of the total. But for the first time in the Journal study’s 28-year history, three of the 10 highest-paid executives in the overall sample are women.


They are Meg Whitman at Hewlett Packard Enterprise Co. , Virginia “Ginni” Rometty at International Business Machines Corp. and Indra Nooyi at PepsiCo Inc.

Most of the 21 female leaders advanced into their roles within a company rather than getting recruited. “These women must be exceptional” because so few reach the corner office, said Heidi Hartman, president of the Institute for Women’s Policy Research.

S&P 500 businesses now run by women generated a median total shareholder return of 18.4% in 2016, compared with 15.7% for those commanded by men. Returns at female-led firms outperformed male-run companies in three of the previous five years. Total shareholder return measures changes in a company’s stock price and dividend payments.

“The board of a company with excellent shareholder returns and operational results likely will reward the CEO more, regardless of gender,’’ said Irv Becker, an executive-pay specialist for Hay Group, a unit of recruiters Korn/Ferry International.

Hewlett Packard Enterprise Co. CEO Meg Whitman, pictured in 2014 on the floor of the New York Stock Exchange, saw her pay double in the year ended Oct. 31 as the company posted a total shareholder return of about 55%. Photo: Associated Press

At HP Enterprise, which posted a total return of about 55%, Ms. Whitman earned $35.6 million during the year ended Oct. 31. The technology giant emerged from Hewlett-Packard Co. ’s 2015 split into two businesses. The CEO made double the $17.1 million she earned a year earlier while running the combined company.


Ms. Whitman’s latest package included a special equity grant tied to the debut of HP Enterprise. Aside from such one-time items, “Meg’s target compensation has remained unchanged over the past three years,’’ a company spokeswoman said, describing part of her package.

Mylan NV had the lowest one-year return among women-led concerns, posting -29%. The drugmaker faced a furor over hefty price increases for its lifesaving EpiPen. Longtime CEO Heather Bresch received $13.8 million last year, down from $18.9 million the previous year.

“We place a clear emphasis on variable, performance-based compensation,’’ with about two-thirds of Ms. Bresch’s 2016 annual target compensation tied to performance, Mylan’s proxy statement said. Directors also cited its share price’s appreciation during the past five, 10 and 15 years. Mylan declined to comment further.

Certain female chiefs earned hefty pay packages because they’re trying to transform their employers. “Turnaround CEOs always get a premium because a turnaround is hard,’’ said Jan Koors, a senior managing director for Pearl Meyer, a compensation consultancy.


As their pay packages reach the highest tier, some female CEOs are coming under additional shareholder scrutiny. Consider Ms. Rometty. IBM’s leader is trying to offset waning older businesses with younger ones such as cloud computing, but revenue fell for the 20th consecutive quarter during this year’s first three months.

IBM paid Ms. Rometty $32.7 million last year, up from $19.8 million a year earlier. Her 2016 package included 1.5 million stock options, which she can’t fully exercise unless IBM’s stock price increases as much as 25%, according to its proxy.

But Ms. Rometty can keep those options for 10 years. “There’s very little downside risk,’’ said Aeisha Mastagni, a portfolio manager for California State Teachers’ Retirement System, which owns 2.2 million IBM shares. “It’s not like she has been underpaid under her tenure as CEO.’’

Many IBM shareholders consider Ms. Rometty overpaid. About 46% of votes cast at this spring’s annual meeting opposed the company’s executive pay practices. That represents a record level of IBM investor opposition for a “say-on-pay” vote. The nonbinding referendum began in 2011.


Directors will review results of the 2017 shareholder votes “as they do every year,’’ an IBM spokesman said.

Write to Joann S. Lublin at joann.lublin@wsj.com