Macy’s is laying off 831 employees in San Francisco at its Macys.com division amid plans to shift tech operations to Atlanta and New York, amid a broader retrenchment that is seeing it close 125 stores nationwide.

In a letter filed with the state of California on Monday, the retailer said the layoffs would take place between April and August of this year and impact everyone from software engineers to technical leads. The division has its own office at 680 Folsom St. in San Francisco and includes Macy’s product and digital revenue and technology teams.

“After careful consideration, Macy’s offices in San Francisco will close. We believe these changes will eliminate any duplication of efforts, bringing these teams closer to our business teams and strategy,” Emily Workman, a Macy’s spokeswoman, said in an email.

Eligible Macy’s workers in San Francisco will be given severance, including outplacement resources, and some will have the opportunity to transfer, Workman said. She added that Macy’s employs more than 5,000 people at 20 Macy’s stores in the Bay Area.

“I think it’s an unfortunate example of yet another major company leaving San Francisco,” said Jay Cheng, public policy director at the San Francisco Chamber of Commerce. “The business conditions in San Francisco have become untenable.”

It’s the city’s biggest round of layoffs in three years, said Ted Egan, San Francisco’s chief economist. Centerplate, the food caterer for the San Francisco Giants, laid off 1,330 employees in connection with its 2017 sale to French company Sodexo.

Although the local tech sector is booming, retailers have struggled as customers shift to online shopping. Mall anchors like Sears, JC Penney and Macy’s have shuttered stores amid bankruptcies and lower foot traffic.

“It more likely says more about the state of retail than the state of tech,” said Egan. Other non-tech companies such as McKesson and Bechtel have also left San Francisco as office rents and housing costs have soared to record highs, and Egan said Macy’s appeared to be making a similar cost-cutting decision.

“It’s a reminder that we’re a very expensive place to do business,” he said.

Macy’s is also planning to close a fifth of its locations over the next three years, the company said Tuesday. Overall, it’s cutting 2,000 corporate jobs or 10% of its staff and will make New York its sole headquarters and close its second headquarters in Cincinnati, according to the Wall Street Journal.

Macys.com has been based in San Francisco since 1998, when the retailer’s parent company established it as an independent division, at a time when many established companies saw the potential to spin off their internet subsidiaries amid a mania for dot-com stocks. Its closure marks another blow to established retailers’ hopes of competing with Amazon.com and startups. Few other retailers retain distinct e-commerce arms, preferring to integrate their websites and stores, though Walmart.com, the Arkansas retailer’s e-commerce arm, remains a distinct operation headquartered in San Bruno.

Macy’s has steadily downsized its physical presence in Union Square as it scales back on flagship stores. Last January, it sold the historic I. Magnin Building for $250 million. The new owner is proposing upper-floor condos and office space. In 2016, it sold its men’s store at 120 Stockton St. for $275 million to Morgan Stanley and Blatteis & Schnur, which are also adding office space to that building. It also closed a store in San Francisco’s Stonestown mall in 2018.

Macy’s leases 243,000 square feet at 680 Folsom St., and its lease expires in 2028, according to real estate brokerage data. A spokesman for real estate brokerage JLL said it is marketing the space for sublease.

Macy’s on Wednesday is expected to unveil more details of a three-year strategy to adapt to the rise of e-commerce. The Cincinnati Business Courier reported that Macy’s is expected to unveil a new, smaller type of store called Market by Macy’s, with the first one opening in Southlake, Texas, Thursday.

Shwanika Narayan and Roland Li are San Francisco Chronicle staff writers. Email: shwanika.narayan@sfchronicle.com, roland.li@sfchronicle.com Twitter: @shwanika, @rolandlisf