Fabric from a cotton sheet combined with material from a prom dress, an old tie, or a pair of pajamas could be used to make a mask with a filter that’s nearly as good as the N95 mask, according to new research.

A new study from researchers at the University of Chicago says that a combination of cotton with silk, chiffon, or flannel can create a well-functioning filter.

However, the researchers and other experts say there’s a big caveat: If your mask leaks around the edges, unlike the tightly fitted N95, your homemade filter will lose its effectiveness.

“We found that many common fabrics can be surprisingly good at filtering particles,’’ said Supratik Guha, a University of Chicago professor and author of the study, which was published Friday in the journal Nano.

Tighter-woven cotton alone was found to be effective, particularly two layers of 600 thread-per-inch cotton. So was a cotton quilt made of two 120 thread-per-inch cotton sheets, with a 0.5-centimeter batting of cotton, polyester, and other fibers. Four layers of silk — imagine someone bundled up in a scarf — also performed well.

But the best overall filtration was provided by a sandwich consisting of one layer of the tighter-woven cotton plus two layers of silk, or two layers of chiffon, or one layer of flannel — because of the electrostatic filter created by the non-cotton layers.

“We speculate that the enhanced performance of the hybrids is likely due to the combined effect of mechanical and electrostatic-based filtration,’’ the study said. “Combining layers to form hybrid masks . . . may be an effective approach."

An electrostatic layer is a vital component of a mask if the efficacy is to be close to that of an N95, according to Jill Crittenden, a research scientist at the Massachusetts Institute of Technology who was not involved with the study.

“The benefit of having an electrostatic layer is that it can trap liquid droplets and other particles based on charge rather than the pore size,’’ said Crittenden, also a member of N95 Decon, a group of scientists who review and publish information about N95 mask decontamination.

The problem is around the edges.

“The bad thing about using masks that have really high filtration is that, if there are any gaps in the mask, the air is just going to go through those gaps than through the filter,’’ Crittenden said in a telephone interview with the Globe. "It’s important to have a mask that has high breathability and high airflow, and that’s not typical of cloth masks.’’

In some cases, gaps decreased mask efficacy up to 60 percent, said the University of Chicago researchers in their report.

“You could have the best fabric material around, but if you’re not planning to minimize those gaps, the effectiveness really drops,’’ Guha said.

That comes as no surprise to many who have worn homemade masks and find their glasses fogging up because of leakage when they breathe.

In the weeks since the pandemic unfolded, many people have been scrambling for ways to craft masks at home. The US Centers for Disease Control and Prevention recommended wearing masks in public but officials have discouraged people from buying N95 masks needed by health care workers and first responders.

The Boston Globe posted a video on Instagram showing how to make facial coverings using just two hair ties and a piece of cloth.

In early April, the US Surgeon General posted a video on Twitter demonstrating several ways to make a mask out of household materials.

However, even a well-made mask won’t be as effective as the coveted N95 mask, which has been tested for decades and is used in hospitals by medical professionals working directly with infected patients, researchers said.

“I wouldn’t go as far to say they’re as good as N95 masks,’’ Supratik said.

But they will do some good.

“Our results support the notion that using cloth masks as opposed to not using anything is a big improvement,’’ he said.

Scientists believe the virus can be transmitted through talking, sneezing, or breathing. Masks can protect someone from inhaling the virus and also prevent someone who has the virus from transmitting it, including those who are not manifesting symptoms, officials said.

“It’s widely accepted that wearing a mask of any type will stop droplets from going far,’’ Crittenden said. “Any cloth mask is very beneficial.’’

Matt Berg can be reached at matthew.berg@globe.com. Follow him on Twitter @mattberg33.