Bay Area health care workers have been pleading for more protective gear, saying some hospitals are forcing them to reuse masks because the nation is running out. A few local companies have responded with massive donations.

They range from the famous, like Facebook, the giant Menlo Park social network, to the less well known, like Flexport, a San Francisco startup ideally positioned to assist because its software helps with global supply chains.

The donations come as President Trump called on American manufacturers over the weekend to switch their assembly lines to making ventilators.

Facebook plans to donate 720,000 masks — a combination of the coveted N95 respirators and more basic surgical masks — and 1.5 million pairs of gloves to health care workers around the world. Facebook officials said they bought the masks for their offices’ emergency disaster kits following wildfires in California.

Facebook has already donated 375,000 masks and 867,000 pairs of gloves to county officials in Alameda, Contra Costa, Marin, San Francisco, San Mateo, Santa Clara and Santa Cruz counties, who are expected to distribute them to hospitals.

“As the situation continues to change, our commitment to our community will only get stronger,” Facebook chief operating officer Sheryl Sandberg wrote to employees in an internal memo Saturday.

Last week, Flexport donated 60,000 masks and other supplies to San Francisco health care workers, and Pacific Gas and Electric Co. said it would donate 950,000 masks to hospitals across the state.

Facebook also said it has donated $650,000 worth of food to more than a dozen Bay Area senior centers, schools and other organizations, including Food Runners SF, Peninsula Volunteers Meals on Wheels and the East Palo Alto Senior Center. Meanwhile, the company sent $250,000 to the Sequoia Union High School District in San Mateo County to pay for 2,000 Wi-Fi hotspots and a year of Wi-Fi for low-income students who need to complete their work online during shelter in place but don’t have a reliable connection.

The company, which is the dominant employer in its headquarters city but also has large offices in San Francisco, Mountain View and other Bay Area cities, also pledged to give $500,000 to multiple homelessness prevention organizations in the Bay Area — and promised more local support.

“We greatly appreciate Facebook’s support in helping us to make sure our front-line health workers are protected as they do the critical work to save lives,” said San Francisco Mayor London Breed. “I’m proud that the city is coming together in the face of this unprecedented crisis, and I know we will get through this incredibly challenging time.”

The donation from Flexport, which uses software to make international trade more efficient, includes 60,000 surgical masks, 34,000 gloves, 2,000 surgical gowns and 50 thermometers. Breed announced the delivery Saturday in conjunction with Supervisor Catherine Stefani, who served as an intermediary.

Officials said they would put the supplies to immediate use in San Francisco’s Emergency Operations Center.

“Our front-line health care workers and first responders are doing heroic work to protect people and save lives during this crisis,” Breed said, noting the need for more equipment as the city braces for a surge of COVID-19 cases.

Hospitals throughout the country are confronting a scarcity of masks and other gear, which became so dire in Washington state that medical workers made 500 masks out of vinyl, tape, foam and elastic purchased at Home Depot. The Centers for Disease Control and Prevention updated its guidelines, allowing workers to use bandannas, scarves and homemade masks as a last resort.

Experts cited several reasons for the shortage, including the rapidly spreading virus — which quickly stripped hospitals of their supplies — and a consumer buying spree. Also, hospitals rely on manufacturers from China and Italy for their supplies, said Brent Andrew, spokesman for San Francisco General. Both countries were hit hard by the coronavirus, which led to disruptions.

In San Francisco and elsewhere, concerned citizens have rallied hospital donations online while elected officials work behind the scenes.

“I was thrilled — but not surprised — to hear that Flexport is stepping up to deliver thousands of much-needed surgical gowns, gloves, masks, and more to our local efforts to flatten the curve,” Stefani said. “When we all step up, there’s no challenge too great for San Francisco.”

Around the country, factories that crank out cars and trucks were looking into making much-needed ventilators. Distilleries intended for beer, whiskey and rum transformed to instead turn out hand sanitizers and disinfectants. And an electronics maker that builds display screens was repurposed for surgical masks.

All are answering the call of duty amid a pandemic that has so far claimed more than 14,000 lives and sickened 335,000 people globally.

But redirecting plants to make completely different products will take a long time and a huge effort — possibly too long for some companies to help with medical gear shortages that become more acute every day.

“When you are repurposing a factory, it really depends on how similar the new product is to the existing products in your product line,” said Kaitlin Wowak, a professor at the University of Notre Dame who focuses on industrial supply chains. “It’s going to be a substantial pivot to start producing an entirely different item.”

On Friday, President Trump said he invoked the Korean War-era Defense Production Act, which allows the government to marshal the private sector to fight the COVID-19 pandemic. But he did not give examples as to how he was using it.

No automakers, however, are building ventilators at present. GM announced on Friday that it is working with ventilator maker Ventec Life Systems to ramp up production. The automaker said it would help with logistics, purchasing and manufacturing, but stopped short of saying it would make ventilators in its own factories, which have been idled for two weeks after workers who’d been fearful of contagion put pressure on the company.

Crosstown rival Ford, which also suspended factory production along with other automakers with operations in North America, confirmed that it too was in discussions with the Trump administration about helping.

“We’re looking at feasibility,” Ford spokesman T.R. Reid said. “It may be possible, but it’s not ‘you go from Rangers (small pickups) one day to ventilators the next.’ We’re figuring out what is possible now.”

Other industries may be better equipped to help with the virus. Rum producer Bacardi, for example, said its distillery in Puerto Rico has shifted to making ethanol needed to produce hand sanitizer. Anheuser-Busch said Saturday it would start producing and distributing sanitizer.

Even though it may take time and a monumental effort to switch factories to medical products, that may have to be done if the virus outbreak lasts for several months or longer, said Notre Dame’s Wowak.

“I think given the circumstance and how critical it is for these surgical masks, ventilators and gloves, I think there is going to be a lot of organizations, government, private, trying to increase (factory) capacity,” she said. “Maybe the government recognizes how critical of an issue this is.”

San Francisco Chronicle staff writer Dominic Fracassa and the Associated Press contributed to this report.

Janelle Bitker and Rachel Swan are San Francisco Chronicle staff writers. Email: janelle.bitker@sfchronicle.com, rswan@sfchronicle.com Twitter: @janellebitker, @rachelswan