Think running retail stores is more expensive than selling online? Think again.

Where do apparel retailers make the largest profit?

Conventional wisdom suggests that running retail stores is more expensive than selling the same merchandise online.

Conventional wisdom is wrong.

It may also seem that using existing retail stores as mini-distribution centers to fulfill online orders for shoppers is a less expensive option than full-fledged distribution centers.

But in actuality, it's typically the most expensive option.

As more and more shopping shifts online, retailers are working hard to capture the sale, no matter the cost. But when it comes to profitability, an online sale is not an equivalent replacement for that same item purchased in store.

Retail consultancy AlixPartners built models for CNBC to illustrate an approximation of the financial differences an apparel retailer might see when selling $100 worth of goods in-store and the same $100 worth of goods online.

Buy in-store

The AlixPartners models begin with a typical $100 clothing purchase made by a shopper in a physical store, with a typical cost of goods sold — or what the retailer paid to have that clothing manufactured — of about $40.

Then, there is the cost of running stores, but because those costs are considered "legacy" costs — and have been in place for many years — there's a maturity and scale to them, making them more efficient, and less "expensive" relatively, than the cost of running online operations.

In a physical retail store, a shopper, effectively, picks out her own merchandise, and gets it home herself, so there's no additional "picking, packing, shipping" cost paid by a retailer with this model.

Thus the $100 outfit has associated operating costs, like rent, overhead and labor of about $28.

So a $100 purchase, minus the $40 cost of the goods, minus the $28 operating costs associated with that unit of clothing, leaves a profit margin of 32 percent.

Buy online, ship from distribution center

Now, consider a shopper instead goes to a retailer's website to search for and buy that same $100 outfit, with the same $40 cost. The model assumes that the $100 purchase comes with free shipping, which is fairly typical for a purchase of that value.

There are costs associated with processing an online order. In this case, it has to be picked, packed and shipped to the shopper from a distribution center.

It's much more expensive on a per item basis, for a retailer to ship individual orders, one at a time, from fulfillment centers to consumers' homes, than it is to send a truckload of inventory from a distribution center to a store.

So, for the retailer, the clothing shipped from a distribution center would have associated operating costs of $30, slightly more than the in-store operating costs.

The higher operating costs in this model result from distribution costs that can be four times higher, and overhead and infrastructure costs that can be three times more than an in-store model.

"Overhead and infrastructure cost is where strategy comes into play," explained Pete Madden, a director at AlixPartners. "A retailer has to make decisions. Do I own my [distribution center]? Do I pay a third party to do it for me? The cost for certain corporate functions, associated with running distribution centers like IT and marketing, can be in the tens of millions of dollars in terms of investment."

There's also the investment to build and manage websites, apps, distribution centers, and establish shipping networks or partnerships to fulfill those orders.

Online operations also have other incremental costs when it comes to acquiring and then taking care of customers, Madden said. A retailer needs systems to help shoppers with order management and tracking, and to show them where inventory may be available (i.e., online only, or available in certain stores). Plus there's a cost to manage the complexity of the "endless aisle" online, logistics and IT coordination with shipping vendors like FedEx and UPS, and increased marketing spending for search engine optimization to drive shoppers to their websites.

"All these costs," said Madden, "until they slow and until online grows into a larger share of business, will continue to outpace any similar costs for legacy stores."

Which means, all of it together makes a retailer's online business much more like a start-up, with less scale leading to higher costs and lower profitability, compared to its legacy store networks.

Put it altogether, and AlixPartners models that the same outfit purchase made online and shipped to a consumer has a profitability breakdown as follows: $100 purchase price, minus the $40 cost of the goods, minus the $30 operating costs associated with that unit of clothing, leaving a profit margin of 30 percent.

Buy online, pick-up in store

Now that many retailers can serve shoppers both in-store and online, there are increasing instances of consumers looking for the convenience of ordering merchandise online, but picking it up in-store. In some cases, it may be faster or even more convenient for shoppers to pick-up in store, than waiting for home package delivery.

But, offering a "buy online pickup in store" option, means a retailer is paying to operate both channels. So when breaking down the operating cost to fulfill that order, you have to account for all the aforementioned operating costs of running both channels.

So that same $100 outfit that cost the retailer $40 to buy, now comes with associated operating costs of $37 dollars spread over both the store and web operations, leaving an operating a profit margin of 23 percent.

Buy online, ship from store

Leveraging stores as distribution centers sounds like an efficient, lower cost option. But it's not.

It's true that in many cases, stores are considerably closer, geographically, to shoppers than distribution centers, which are often located in less populated areas.

But, using stores as distribution centers is the least profitable model.

The main reason for the compressed profitability is the cost of double-shipping merchandise.

But the retailer would do this if it means keeping a shopper happy by getting that shopper merchandise faster.

As a retailer, you are operating two channels, and shipping that merchandise twice, to fulfill an order placed online but shipped to a consumer from a store. Generally, store merchandise gets there by the semi-truckload, so a retailer has paid for that distribution cost once.

A mom, right, shopping with her daughters at a JC Penney store in Aurora, Colorado.
Matthew Staver | Bloomberg | Getty Images

Then, if an order placed online is fulfilled from store merchandise, employees at the store have to pick, pack, and ship individual orders to a shopper's home.

Not only has that same outfit now shipped twice, at the retailer's expense, but the "last mile" or the final leg of the delivery journey is far by the most expensive.

So back to our example. The $100 outfit, with a $40 cost, now has associated operating costs of $48 when ordered online but shipped from a store, leaving a profit margin of 12 percent, a full 20 percentage points lower than a pure in-store sale.

The cost of returns

AlixPartners explains that the cost of returns is not discussed in the models as it's very difficult to factor in numerically, but it is critical to understand, as it's especially costly for online purchases.

Clothing items bought online are returned three times more than items bought in-store on average. But processing those online returns can be six times more expensive compared to in-store.

Industry standard suggests 30 to 40 percent of all clothing bought online ultimately gets returned. This makes sense given it's very hard to know how clothing will fit and feel without seeing it in person first. Plus, consider that many consumers may order the same clothing item in several sizes or colors online, only ever intending to keep one.

So, if the items are shipped for free to the shopper, and returned at no cost to the shopper, that leaves the retailer absorbing shipping costs both ways on up to 40 percent of all clothing items bought online.

But stores do offer a higher chance to recapture some profit.

If a retailer has a store network, like in our model examples, many consumers will choose to return in-store and then there's a much higher chance the consumer will buy something else on that trip. Target says one-third of shoppers that pickup online orders in store buy something else.

An in-store return can lower the cost somewhat, since return shipping may not be paid by the retailer if the item stays in store and can be resold.

But, there is a cost to re-process the item, and it may end up being shipped back to a distribution center, but this time in bulk with other items. In other cases, it's a lost sale entirely and the item counts as a loss, along with all the other returned goods that can't be resold.

Making online less expensive

Most retail experts think that both stores and online options give retailers the best chance for success to optimize the shopping experience. The big question is what percent of sales should come from each channel to achieve maximum profitability, and when will the industry hit that equilibrium.

There are a number of actions retailers can take to increase their online profit margins including growing the size of the online sales channel to scale the overhead and the investments, Madden said. Additionally, retailers should look for ways to lower shipping, or consider upping free shipping minimums. Figuring out how to lower return frequency is a big cost saver, as is encouraging shoppers to bring their online returns into stores for hopes of picking up additional sales.

Testing the model: J.C. Penney's experience

While the AlixPartners models will approximate the cost many apparel retailers are facing across channels, the profit margin of course will vary from retailer to retailer depending on many factors, decisions, investments and capabilities.

J.C. Penney said its profitability order is a little different, with in-store being the most profitable. The order online, pick up in-store option is the second most profitable, followed by order online, ship from distribution center, and lastly order online, ship from store.

On its fourth-quarter earnings call, J.C. Penney CEO Marvin Ellison said 77 percent of online purchases touched the store in 2016. Ellison further explained to CNBC "every time an online order touches the store, it actually helps the margin. The real pain point is the fulfillment price, it's always cheaper to ship from a distribution facility to a store than to a consumer."

So for the department store, there are two reasons the order online, pick up in store option is the second most profitable method.

First, J.C. Penney says when an online order is picked up in store, at least one-third of those customers will make an additional purchase in store of about $50. (Incremental sales were not captured in the AlixPartners models.)

Second, the same-day pick up feature uses inventory already in the store, so no shipping to store is necessary. But, the department store's "free ship to store" feature — which takes four to seven business days and is offered free for orders over $25 — is done using Penney's weekly delivery trucks to lower that shipping cost. Because its stores are replenished with new merchandise each week, it's cost-effective to load that same truck with orders that customers have chosen to pick-up in that store.

J.C. Penney spokeswoman Daphne Avila said that even though it's least profitable to fulfill an online order by shipping from the store, it's "still more advantageous to 'save the sale' and not disappoint a customer. In the past, we lost the sale if our distribution center couldn't have the item in stock. Now we're developing an enterprise-wide view of our inventory so we can better meet customer demand."

Watch: Wal-Mart in talks to acquire Bonobos

Wal-Mart in talks to acquire Bonobos, Amazon may be interested in BJ's