Employees of Costco Wholesale Corp. and Home Depot Inc. saw demand for their services swell last year as homebound Americans stocked up on food and remodeled their homes. But Costco’s median worker made 16% less in 2020 than in the previous year while Home Depot’s made 21% more.

The divergence doesn’t mean one chain paid better than the other. It reflects how the pandemic and companies’ varied responses to it fundamentally altered the makeup of their workforces, fueling sometimes counterintuitive swings in median employee pay. (See what the median worker was paid at S&P 500 companies.)

Home Depot instituted a range of temporary pay increases to reward existing workers, lifting its pay structure. So did Costco, but that move was more than offset by a flood of new hires brought in to meet demand, tilting the balance of its workforce toward lower earners.

Median pay moved in opposite directions at some close competitors as well, again with changes in the compositions of their workforces. At American Airlines Group Inc. and Southwest Airlines Co. , thousands of employees were furloughed, took unpaid time off or left the companies as air travel stalled. Median pay rose 20% at one and fell nearly 35% at the other. Much the same happened at the big cruise lines: Two reported median pay more than 50% above 2019 levels—a third reported a 50% drop.

Complex rules for reporting median employee pay also contributed.

U.S. publicly traded companies have been required to disclose the pay of their median worker since 2018 based on their global workforces. Although the employee’s pay must be calculated the way executive pay is tallied for disclosure purposes, companies can use a range of pay to identify the median worker—the person in the middle when the workforce is lined up from highest-paid to lowest.

Low-wage work is in high demand, and employers are now competing for applicants, offering incentives ranging from sign-on bonuses to free food. But with many still unemployed, are these offers working? Photo: Bloomberg The Wall Street Journal Interactive Edition

A key element behind some of last year’s big changes: existing rules requiring companies to include part-time, seasonal and temporary workers when identifying pay for the median worker, which took on new importance during the pandemic as furloughs and new hires drastically changed the makeup of workforces. In a year when many workers went without pay for months, that alone made a huge difference in some cases.

Here is how median employee pay changed during the pandemic for companies in two hard-hit sectors.

Retail

New hires brought median employee pay down.

Costco’s median worker made $39,585 last year, roughly 16% less than its median worker earned in 2019, even as it raised wages for many employees.

The warehouse-store chain closed out its fiscal year in August, with economic uncertainty still high. Ordinarily, about 55% of the company’s staff works full time, the rest part time, said Bob Nelson, senior vice president for financial planning and investor relations. Costco typically hires seasonal workers as the winter holidays approach.

But last year, customer demand surged over the summer and the company hired 13,000 to 15,000 seasonal workers to meet it, and to fill in for more-experienced employees who were absent, Mr. Nelson said.

“We had literally thousands of employees who weren’t coming to work—they were high risk, they were over 65, they had an illness of some sort,” leaving them more vulnerable to the new virus, Mr. Nelson said. At the same time, he said, “we were two to three times busier than we expected to be.”

The result: many more new workers, whose pay tends to be lower. The overall pay structure shifted down, bringing the median figure down as well. Considering just full-time workers, Costco’s median employee earned $56,569, little changed from 2019’s $56,755, the company said in its proxy.

Overall, Mr. Nelson said, Costco increased wages in 2020 and continues to do so this year. The company’s average hourly wage is currently $27.71, up from $26.78 last year—that was before a $2-an-hour Covid-19 premium paid for part of last year—and $24.98 in 2018.

Business also boomed at Home Depot, but there it pushed up median pay. The home-improvement retailer’s median worker made $27,389 last year, 20.9% more than in 2019.

The company attributes the rise to pandemic-related pay initiatives. For several months, Home Depot added $100 a week to full-time paychecks and $50 to part-time ones, a spokeswoman said. It paid double for overtime. Full- and part-time workers received 80 and 40 hours of paid time off that they could cash out at year’s end if it went unused, with additional time for those who contracted Covid-19, came into contact with someone with the virus or were considered at higher risk from Covid-19 because of age or chronic conditions.

Plus, strong financial results pushed up “success sharing” bonuses for nonmanagement workers, the Home Depot spokeswoman said.

Elsewhere, closures lowered median pay. L Brands Inc., owner of the Victoria’s Secret and Bath & Body Works chains, shut stores to help prevent the virus’s spread—in some cases more than once, as local restrictions changed—and furloughed workers along the way, a spokeswoman said.

In addition, as part of a longer-term strategic change, the company permanently closed more than 200 of its Victoria’s Secret stores, which tended to employ more full-time workers. That left Bath and Body Works employees, who are more often part-timers, making up a bigger share of the company’s workforce, pulling median pay down, the spokeswoman said.

Median pay at L Brands fell 26.8% last year, to $9,876 from $13,490, the company said in its proxy. Annualized, the part-time employee’s pay would have been about $26,500, the company said.

Airlines including Southwest made adjustments in staffing as they struggled through slower pandemic travel.

Airlines including Southwest made adjustments in staffing as they struggled through slower pandemic travel.

Photo: David Paul Morris/Bloomberg News

Travel

At the airlines, median-pay figures diverged. American Airlines reported a rise—by just over 20%, to $73,703 from $61,143 in 2019. Delta Air Lines, United Airlines and Southwest said median pay fell.

American furloughed 19,000 people in October, by seniority, as federal employment support for the industry dried up. “The most junior employees in each impacted work group were subject to furlough,” a spokesman said. “And those junior employees are at lower pay rates than their more-senior colleagues.”

SHARE YOUR THOUGHTS

How has the job market near you changed during the pandemic? Join the conversation below.

That left more higher-paid employees on American’s books when the company identified its median-pay figure at the end of October, the spokesman said. American later reinstated furloughed employees effective Dec. 1.

United furloughed workers and paid them retroactively after new federal aid legislation passed in December, so they stayed on the books when the airline identified its median worker on Dec. 31, a spokeswoman said. With so many flights halted, airline workers had less opportunity to earn overtime. Median pay at United fell 15.1% to $63,496 from $74,750.

Delta’s median pay fell 38.8%, to $72,308 from $118,198 in 2019, the company said in its proxy. A spokeswoman attributed the change primarily to voluntary departures and early retirement programs implemented during the pandemic, which reduced the ranks of more-senior, higher-paid employees. In addition, ground staff had their hours reduced 25%, and Delta’s losses meant no profit-sharing payments.

At Southwest, median pay fell 34.6% to $66,269 in part because of new employees hired before the pandemic as well as “the departure of certain employees in 2020 in connection with the company’s voluntary-separation program,” a spokesman said.

Write to Theo Francis at theo.francis@wsj.com