What’s so difficult about buying a mattress? If you have to ask, you haven’t shopped in a mattress store lately. In the quest for a perfect night’s sleep, shoppers schlep from one cavernous bedding store to another, confronted by row after row of overpriced mattresses and huckster sales folks who claim, “I have such a deal for you.”

Frustrated by this experience, a new breed of entrepreneurs is taking on the mattress industry with the promise of the perfect mattress at the perfect price—and no pesky salespeople. The catch? You have to order the mattress online, and it arrives on your doorstep compressed into a box the size of your coffee table. No store. No sales pitch. No kidding.

More on Mattresses

While Casper gets a lot of the credit for the concept, the bed-in-a-box was actually invented by a machinist from Johnson City, Tenn., in 2007, seven years before Casper launched. Bill Bradley, founder and CEO of Bed in a Box, built a machine that could compress and roll foam mattresses to a size small enough to fit in a shipping box. He trademarked the name and ran with it.

Bradley’s business (bedinabox.com) didn’t make that big a dent in an industry still dominated by long-established players like 1-800-Mattress and Mattress Firm. It wasn’t until Casper and early competitors like Tuft & Needle came on to the scene—sometimes backed by venture capital—that shoppers began to wonder: Should I really buy a mattress online?

“The idea of ordering a mattress online, the same way you make much smaller purchases, is still a novelty, even though it has been an option for several years,” says Claudette Ennis, the analyst who follows the mattress market for Consumer Reports. “Beds-in-a-box represent just a small part of the market today, but we’ve seen some pretty remarkable growth in this category.”

According to a report by the trade publication Furniture Today, direct-to-consumer mattress companies now command 12 percent of the market, up from 6 percent in 2014. Most beds-in-a-box are foam, but some manufacturers have found inventive ways to cram innerspring and adjustable air mattresses into cartons, too.

To make the process as pain-free as possible, many bed-in-a-box firms offer free shipping, and generous trial periods—usually 100 days, sometimes longer—and return policies. (Policies may differ if the mattress is purchased from a third-party retailer, such as Amazon.) Compare that with Macy’s, where returns must be made within 60 days of purchase.

The success of major bed-in-a-box purveyors such as CasperLeesa, and Tuft & Needle has inspired dozens of copycats. Industry sources report that the number of online mattress retailers is now approaching 200, and many are puffing up their marketing messages in an attempt to be heard above the din. “Goldilocks found the bed that’s just right, and now you can too,” Purple touts. “The internet’s most comfortable mattress,” Tuft & Needle declares. “Tirelessly engineered sleep products for your best rest,” Casper claims.

In short, they’re promising to make your sleep dreams come true. Our rigorous, scientific mattress testing and ratings will help you separate hype from reality and guide you to the choice that’s best for you.

Here, the best way to purchase and set up a bed-in-a-box:

A Workaround for Comparison Shopping

One of the most frustrating things about buying a mattress has long been how difficult manufacturers make it to comparison shop. Unlike products that have the same name or model number no matter where they’re sold (a Samsung Family Hub refrigerator, for example, or a Vitamix blender), mattress makers ­often give the same model different names depending on where it’s sold, making it almost impossible for a consumer to compare prices. (They might also make slight changes in construction or materials from one retailer to another.) So don’t expect a salesperson to be able to guide you to a comparable model.

Bed-in-a-box sellers have eliminated this frustration from the buying process by paring down the choices. Many of these companies sell just one mattress, betting that it will suit most sleepers. Our testing shows that in theory, at least, this approach can work.

“We’ve seen several bed-in-a-box mattresses come through the lab that perform consistently, at a level of Good to Excellent, for sleepers of every body size and sleeping style,” says Chris Regan, a test engineer who oversees CR’s mattress tests. In fact, the top-rated foam beds-in-a-box score Very Good or Excellent in our support tests for petite, average, and large and/or tall sleepers.

Say Goodbye to ‘Try Before You Buy’

CR has long advised readers to lie on a mattress in a store for at least 10 to 15 minutes before buying. We still consider this critical. Our most recent mattress survey showed that the longer people try out a mattress before buying it, the more likely they are to be satisfied with their purchase. Ordering online prevents this opportunity.

Certain companies have worked around this limitation by teaming up with walk-in retailers. For example, you can now try a Leesa mattress at West Elm and buy it there for the same price offered at leesa.com. Casper has twin-size mattresses on display at Target that you can curl up on to see how they perform.

Finding your best bed

A handful of the large bed-in-a-box companies have showrooms in large metropolitan areas, so if you’re interested in a different brand but you’re not ready to buy a mattress sight unseen, check the company’s website to see whether it has a showroom nearby. If it doesn’t, you can refer to our mattress ratings. Find your size and favorite sleep position, and note the models that provide adequate support for you—and for your sleeping partner.

Unlike mattresses sold at retail, which are usually marked up significantly and offer more price flexibility, bed-in-a-box mattresses are generally sold at a fixed price, making it difficult to haggle.

But there are other ways to save. Check the sellers’ websites for special offers such as a free pillow, and go to goodbed.com, which lists mattress discounts and coupons with savings of $50 and up. Plenty of bed-in-a-box firms offer discounts around the same holidays that traditional retailers do—Presidents Day, Labor Day, and Black Friday. Use a website’s customer-service chat feature to ask about coming promotions or discounts.

Making Your Mattress Feel at Home

Mattresses usually arrive a few days to a week after an order is placed. Although the cartons are compact (the queen-size Lull, for example, comes in a 19x19x43-inch box), they can be heavy, ranging from 60 to 150 pounds, and difficult for someone to wrangle alone.

Shipping is often free, but for an additional fee almost all of these companies offer white-glove delivery, similar to the services offered by a traditional retailer. Casper charges $75 to $100 to move a mattress into a bedroom and set it up, and an additional $50 to remove the old one.

A bed-in-a-box, which is usually foam, is compressed and rolled or folded (or both) before shipping. Most manufacturers recommend unboxing a new mattress within a month or two after it’s delivered. If you’re setting it up yourself, follow the steps outlined by the manufacturer. If you bought a bed frame or platform, put that together first.

Because it can be heavy and unwieldy when fully open, always take the mattress to the bedroom while it’s still in the box, Regan says. “Once you take it out of the box, put it on your box spring or platform before removing the plastic.” (See “Do You Need a Box Spring?” below.)

“Some will be wrapped in multiple layers of plastic; others have only one,” Regan says. “You can use scissors or a knife to open them, but take care not to puncture the mattress.”

Once the wrapping is removed, the mattress regains the volume that was lost when compressed for shipment. It can take a few minutes to a few hours for the mattress to regain its full shape.

The materials in new mattresses can give off an odor, some of which is caused by the breakdown of volatile organic compounds in the foam. “More research is needed to determine whether or not there are any chronic health risks from long-term exposure to VOCs in mattresses,” says Don Huber, CR’s director of product safety. “The odor should dissipate in a few hours or, at most, a few days. You may want to wait until the odor goes away to sleep on your new mattress.” Opening a window could help the odor dissipate more rapidly.

Do You Need a Box Spring?

A box spring, which serves as a foundation for a mattress, adds to the cost of new bedding, tempting many to do without one. Opinions vary on whether a box spring is really necessary. The International Sleep Products Association says the box spring is responsible for much of the comfort and support a mattress provides, but some mattress sellers say all that many of today’s models require is a sturdy surface, such as a platform bed.

Certain retailers press the issue harder than others. Casper, for example, recommends that buyers of its mattresses use Casper’s own foundation or bed frame. Lull says its mattress will work with everything from box springs to a slatted bed frame to the floor.

Our answer is always the same: Follow the manufacturer’s advice. “Some manufacturers’ warranties require that the mattress be placed on a matching box spring,” says Chris Regan, the engineer who oversees mattress testing at CR. “Not doing so will void the warranty.”

Skipping the box spring can certainly save you money in the short term, but it could cost you far more in the end.

How to Have Many Happy Returns

As the old saying goes, you can’t put the genie back in the bottle. The same is true for beds-in-a-box. Return policies vary, but if you decide you don’t like your mattress during the trial period, you can usually get your money back. Fortunately, you won’t have to put the mattress back in the box.

Some sellers provide a full refund but don’t want the mattress back. Instead, they’ll help you donate it to a charity or nonprofit in your area. Casper and Tuft & Needle say they will help you find a charity that will pick it up. If there is no group in your area that will take it, these companies and others will arrange for the mattress to be picked up.

Many bed-in-a-box companies observe similar trial periods of 100 days or more, but some, such as GhostBed and WinkBeds, require you to keep the mattress for at least 30 days before arranging a return.

In the end, only 7 percent of the beds-in-a-box that are purchased are returned, according to 1010data, a data analytics company. That’s more than the 2.2 percent returned at Mattress Firm but an indication that most consumers are pleased with their purchase.

In case you’re not one of them, be sure you understand the company’s return policy before you buy. And if you have the space and really want to be on the safe side, hang on to your old mattress until you’re sure that you’re going to stick with your new one.