The larger-than-expected cuts are the deepest in the company's 39-year history and come five months into the tenure of Chief Executive Satya Nadella, who outlined plans for a "leaner" business in a public memo to employees last week.
"We will simplify the way we work to drive greater accountability, become more agile and move faster," Nadella wrote to employees in a memo made public early Thursday. "We plan to have fewer layers of management, both top down and sideways, to accelerate the flow of information and decision making."
The size of the cuts were welcomed by Wall Street, which viewed Microsoft as bloated under previous CEO Steve Ballmer, topping 127,000 in headcount after absorbing Nokia earlier this year.
"This is about double what the Street was expecting," said Daniel Ives, an analyst at FBR Capital Markets. "Nadella is clearing the decks for the new fiscal year. He is cleaning up part of the mess that Ballmer left."
Microsoft shares jumped 3 percent to $45.40 in early trading, reaching their highest since the technology stock boom of 2000.
About 12,500 of the layoffs will come from eliminating overlaps with the Nokia unit, which Microsoft acquired in April for $7.2 billion. Microsoft did not say how many jobs would come from Nokia and how many from existing operations. The acquisition of Nokia's handset business in April added 25,000 people to Microsoft's payroll.
The Nokia-related cuts were widely expected. Microsoft said when it struck the deal that it would cut $600 million per year in costs within 18 months of closing the acquisition.
Microsoft did not detail exactly where the remaining jobs would be cut, but said the first wave of layoffs would affect 1,351 jobs in the Seattle area.
The company said it expects to take pre tax charges of $1.1 billion to $1.6 billion over the next four quarters to account for the costs of the layoffs.
Nadella's cuts are the biggest at the Redmond, Washington-based company since Ballmer axed 5,800, or about 6 percent of headcount, in the depths of the recession in early 2009.
The new CEO's moves are designed to help Microsoft shift from being a primarily software-focused company to one that sells online services, apps and devices it hopes will make people and businesses more productive. Nadella needs to make Microsoft a stronger competitor to Google Inc and Apple Inc, which have dominated the new era of mobile-centric computing.
Marking this change of emphasis, Nadella last week rebranded Microsoft as "the productivity and platform company for the mobile-first and cloud-first world."
Microsoft is not alone among the pioneers of the personal computer revolution now slimming down to adapt to the Web-focused world.
PC-maker Hewlett-Packard Co is in the midst of a radical three-to-five-year plan that will lop up to 50,000 from its staff of 250,000.
International Business Machines Corp is undergoing a "workforce rebalancing," which analysts say could mean 13,000, or about 3 percent of its staff, being laid off or transferred to new owners as units are sold.
Chipmaker Intel Corp and network equipment maker Cisco Systems Inc both said in the past year they were cutting about 5 percent of their staffs.