Recently, a team of scientists discovered that around 77,000 years ago, some early humans packed together plants and leaves into a thin mat—the earliest known example of a bed. Clearly, we've been on the hunt for a cozy place to rest our heads for longer than we've been doing practically anything else.

Fast forward to 2018, and bedding involves everything from futuristic memory foam to sensors that track the depth of our sleep. But when you get down to it, mattresses haven't changed much in base principle: They're squishy rectangles that we are very particular about—while some love bouncy coils, others prefer perfectly inflated air pockets.

Today, there are dozens of startup-style companies hocking mattresses you can order online, unroll from boxes, try out in your home, and send back if you want. Google it, and you'll find no fewer than three pages of results filled with brands promising that their bed in a box will arrive at your doorstep with the best R&D behind it—a scientifically proven magic carpet ready to whisk you off to dreamland.

EDITOR'S PICK
{{displayTitle}}

But how true is any of this? We set out to cut through the fluff of these online brands, tapped a couple of sleep scientists, and learned what makes a mattress great—in order to arm you with the info you'll need to sleep soundly.

What should we look for in a bed?

The most important thing to keep in mind when choosing a bed is the concept of personal preference (an oddly subjective basis, but every scientist we spoke with started the conversation with that caveat). In one of the most-cited sleep reference texts, The Promise of Sleep, William C. Dement, M.D., Ph.D. writes, "The fundamental principle is that the bedroom should be a comfortable, secure… place where all the factors that promote sleep can work best for you individually."

But after personal preference, there's a lot to consider: We reached out to Gaby Badre, who holds a Ph.D. in neuroscience and performs sleep studies, and who has some wisdom to share about body types as they pertain to mattresses. While Badre emphasized that you can't offer a one-size-fits-all approach to mattresses, he explains that generally, if you're on the heavier side, a squishy mattress—like one made of memory foam—isn't ideal because you're liable to sink in, you can overheat in the middle of the night, and your movement may become restricted.

That said, a firmer mattress—like those made of latex or highly inflated air—tend not to do well for lighter people because they apply pressure to too many places on your body. In fact, Badre broke down three main principles to look for in your mattress: support (to keep your back aligned), relief (to give you freedom of movement and alleviate pressure on curvier sections of your body), and overall comfort. It's all based on your own body's morphology, so it's important to consider these things and test them out in your home. With these principles in mind, let's get into the makeup of these mattresses.

Is there something in the air?

The first thing that came up in our modern mattress searches was the concept of built-in smart tech. You probably remember those Sleep Number commercials, featuring the happy couple who snooze easily on their two-sided, firmness-customizable mattress. In fact, when we reached out to sleep specialist Michael Breus, Ph.D., he said that air mattresses like Sleep Number can give you a lot of great features. "They do an excellent job of giving great support, and some have sensors built in that adjust the bed while you sleep."

But if you can shell out the dough for one of these bad boys—despite being the cousin of the blow-up thing you sleep on when you're staying in your friend's living room, air mattresses can be pretty pricey—a brand like Sleep Number will send a system to your door that has super-high potential for dialing in shockingly exact levels of firmness. As Badre explains, firmness is hugely important in giving you proper support and proper relief, and air mattresses can be especially great for finding (and adjusting) that firmness.

Sleep Number beds come in a few levels, the lowest being right around $600, offering that adjustable air—but if you pump up that price to $2,000, you can get five additional zones of contour-controlled support. Overall, the functionality is something you can't really get in many of the other mattresses, but with so many foam options to get into, there's more here to consider.

Materials matter—especially when it comes to keeping you cool.

"In general, breathability in a mattress is very important," Badre says. In fact, the optimal sleeping temperature is right around the mid-60 degrees Fahrenheit. The only job of the bed, temperature-wise, is to not get in the way, giving you freedom of movement so you don't cocoon yourself too much and overheat. And Breus agrees. "If I had to choose a mattress material for the general population, it would be latex," he says. "It has the properties of both springs and memory foam, without all the temperature issues." Keeping you cool turns out to be the No. 1 recommended mattress property.

After a look at the five-or-so leading mail order mattress companies, though, it became clear that what their mattresses are made of is a matter that gets complicated fast. That's because most mattresses are made up of a stuff called "high-density foam," which is really a mixture of polyurethane—for which there is really no standard composition.

It's important, however, to look at the difference between these foams and the latex mentioned by Breus. A high-density foam is largely synthetic, and in many cases, it's the basis for memory foam. Latex, on the other hand, begins its life as a naturally occurring material from a rubber plant (though some manufacturers add additional materials to the mix). So foams, by virtue of synthetic chemical lab-testing, tend to have much more possibility for customization from manufacturer to manufacturer, leading to tons of proprietary makeups.

So what, exactly, are most mail-order mattresses made of?

To get to the bottom of all this, we called up some lead engineers at two of the biggest mattress companies out there: Leesa and Casper. Jamie Diamonstein, one of the product heads at Leesa, actually hails from an old-hat mattress family but has been breaking into the bed-in-a-box world as of the past few years. He has a unique view on these chemical foams: "Asking what foam is made of is kind of like asking what bread is made of. There's white bread, wheat bread, rye, and more," he says. "The foam Leesa uses is the result of years of searching for a foam that addresses all of our needs."

EDITOR'S PICK
{{displayTitle}}

Leesa uses an ultra-high density polyurethane foam called Avena, which is actually trademarked by a third-party company. Diamonstein tells us that he didn't originally want to use a high-density foam—he started the search for the right Leesa formula with latex for the exact reasons our experts echoed: You don't sink in, which provides great temperature regulation, and there's plenty of bounce and freedom of movement.

But Diamonstein says that a problem with latex is that it inherently offers less consistency depending on the day (mattress 100 could be vastly different in composition from mattress 500). "Avena is the closest foam that I found to the behavior of latex without being latex, but it also gives the consumer consistency, so every Leesa mattress we deliver is as close to the same as possible," Diamonstein says.

Casper, on the other hand, seems to take a much more varied approach. When we reached out to the R&D team there, they said that their mattresses combined layers of latex and polyurethane— though it's worth noting that they called out "visco elastic memory foam" and polyurethane separately, even though our research seems to suggest that those have the same chemical basis. Casper is a special case because, while they weren't the first company breaking into modern beds in a box, they deserve credit for starting the craze with the most brand recognition. They actually operate a little like a Silicon Valley tech company, having gotten their big push through a sizeable investment from a venture capital firm.

What's interesting is that while Leesa comes at their testing with experience in the traditional mattress world, Casper seems to take their testing from a tech perspective, with a 5,000-square-foot "Casper Labs" space dedicated to testing prototypes. While the testing needs to be kept in perspective (they are doing non-independent, internal testing that is inherently aimed at benefiting their brand), they do put a ton of effort into gauging the temperature regulation of their mattresses, focusing on humidity control, temperature ventilation, and even tests that simulate back sweat, using what they're calling a thermal sacrum machine.

So given the presence of latex—and a firm emphasis on what several of our experts consider the most important consideration in a mattress (temperature)—the Casper mattress could be a good option for you.

But there's more to it than just the materials.

At the end of the day, there is no silver bullet for better sleep, and there are a ton of variables, but there are some base guides for finding a mattress that works for you. Unfortunately, it isn't just about what the materials are but how they're used: Leesa's Avena foam, for all its latex-like qualities, is actually a pretty closed-cell format, which may present some of the temperature-stifling qualities of memory foam. However, the company's already thought of that: They perforate and egg-crate this top layer to help regulate your temp. Casper, on the other hand, has designed their top layer with an open-cell design that gives you plenty of freedom of airflow.

Finally, one more wild card in this search is the concept of "off-gassing." As we mentioned, latex itself is naturally occurring, whereas memory foam is a synthetic concoction of polyurethane foams. Badre hypothesizes that a reason a lot of these companies aren't being forthright with the literal makeup of their polyurethane foam is because we frankly aren't sure how safe the gas released from memory foam is: You'll know it's there if you smell a plastic-y, synthetic smell when you hop on your bed.

There just aren't reliable studies about whether this material is bad for you (except for one that seems to find poor cardiovascular effects in mice, but... mouse studies aren't exactly reflective of human experience). What's the best way to play it safe? According to Badre, you should get a bed that isn't as spongy or memory-foam-y, as it won't project that off-gassing outwardly as much as a memory foam mattress with a ton of give. That's fine, because a bed that lets you stay cool with freedom of movement (which both Leesa and Casper mattresses achieve) is what you're after anyway.

Look closely at the trial periods.

Of course, you need to see firsthand if this mattress is good enough for you. Does it provide you the right support? Does it give you freedom of movement? Does it regulate temperature well enough? All of these bed in a box companies send you the mattress in the mail, which can work out to your advantage: Even if you do go to a mattress store, you aren't getting an accurate test.

"Lying on a mattress in a store in full view of everyone for maybe 10 minutes doesn't even come close to a good test," writes Dement in The Promise of Sleep. You need to try your mattress out in your own home for at least a week ("a minimum of five days, but the longer the better," Badre says). The bed in a box model gives you that option through money-back, no-questions-asked trial periods.

Casper, Leesa, and Purple (another major player in the space) all give you 100 nights risk-free, including free shipping both ways. Ghost Bed and Yoga Bed, a couple of smaller players, are clearly trying to edge out the top dogs, Price Is Right-style, by offering the same hassle-free trial, but for 101 days. Tulo, an interesting brand that offers three Goldilocks-style beds at different firmness levels (soft, medium, and firm), gives you a whopping 120 nights of in-home testing to see which one is just right. But by far the longest trial we found was by a company called Nectar, who offers you a full year to try out their mattress with the promise of a full refund. You could even conceivably try a few of these brands in succession until you find your best fit.

The Bottom Line

Badre says that the ideal scenario would be a mattress that can adjust temperature, firmness, and shape as you sleep, but the technology just isn't there yet—there are no current products he's seen that have passed legitimate medical studies on automatic adjustments. So in the real world of real mattresses, the new mattresses in a box can be a great option.

However, the world of e-comm mattresses is also a suddenly saturated race for brand recognition. In fact, even if you do opt to read third-party reviews of these products, it's common that those sites will be paid or otherwise compensated for that review. (David Zax did some excellent reporting for Fast Company on just how crazy and competitive these companies get).

Whether you're hunting for a mattress based on firmness (taking Tulo's customization model), based on the amount of time they'll let you try it in your home, or you just want something that won't leave you in a pool of sweat, what's most important is that you listen to your body and see what it likes best.

In a way, the modern mattress has always been a brand marketing industry. And while the Leesas and the Caspers of the world have offered risk-free in-home trials and are much more affordable than some of the bloated, spring-loaded pillow tops of the '90s, they've also given us a crowded market with tons of competition. Tread lightly on the research, test comfortably in your home, and you'll rest easy on the right mattress for you.

Jason Schneider is a New York-based copywriter, musician, and redhead. When he isn't writing words on the Internet you can find him watching horror movies and trying his very best to avoid pizza. Follow him on Instagram (@jalanschneider) for new music and cat pics.

READ THIS NEXT: 7 Sleep Tech Products That Can Help You Get a Full Night's Sleep (and a Few That Won’t)