With mall traffic declining steadily, department store giant Macy's (M -2.12%) is looking to downsize to a more defensible footprint. Back in August, the company announced plans to close about 100 stores. Last week, it identified about two-thirds of the locations that will be shuttered. Most of those will close within the next few months.

The main goal of closing stores is that it will better align Macy's brick-and-mortar footprint with consumer shopping trends. However, a secondary benefit is that these store closures will free up a lot of excess real estate that Macy's can sell. That process has already begun and is likely to continue at a rapid pace this year.

Stores aren't all equal

The quality of Macy's real estate spans a wide range. At one end of the spectrum, Macy's sprawling flagship store in Manhattan is probably worth billions of dollars. At the other end, Macy's owns some stores in dead or dying malls that are virtually worthless. For example, it recently unloaded one store in Springfield, Ohio, for the paltry sum of $200,000.

Macy's Manhattan flagship store could be worth up to $4 billion. Image source: The Motley Fool.

A few of the stores that Macy's is closing this year are getting the ax specifically because they are sitting on valuable real estate. Selling these will generate the vast majority of Macy's real estate proceeds. On the other hand, most of the stores slated for closure are located in subpar malls and thus aren't worth very much.

Macy's starts selling its downtown real estate

In the past three months, Macy's has made big progress in selling off some of its city-center real estate. In November, the company announced that it would sell the building containing its men's store in San Francisco for $250 million in a deal expected to close this month. It will lease back the space for two or three years while it moves the men's department into its main San Francisco store across the street.

At the same time, Macy's also disclosed that it had signed a contract to sell its downtown store in Portland, Oregon, for $54 million. That store will close in the next few months.

More recently, Macy's decided to close its Minneapolis flagship store and sell that building. Terms of the deal haven't been officially announced, but the sale price was a little more than $40 million, according to the Minneapolis Star Tribune.

Getting cozy with General Growth

Macy's has also sold several stores to mall owner General Growth Properties (GGP) in the past few months. In late October, Macy's announced that it had sold five stores to General Growth for $46 million during Q3. The bulk of the value probably came from just one of the properties: a store at Tysons Galleria outside of Washington, D.C.

More recently, Macy's sold its store at San Francisco's Stonestown Galleria to General Growth for about $41 million. This store (along with the Tysons Galleria store) will remain open on a short-term lease while General Growth finalizes its redevelopment plans.

Other real estate companies pick up a few properties

Macy's has also sold a handful of stores to other real estate companies. Just this week, The Howard Hughes Corporation announced that it had purchased the Macy's store and parking lot at Landmark Mall in Alexandria, Virginia, for an undisclosed price. This lays the groundwork for a full redevelopment of this valuable site.

CBL & Associates has also purchased three Macy's stores in its mall portfolio. These are all in lower-quality malls, though, so the combined sale price was just $5 million.

Macy's will sell a handful of the stores it is closing to mall owners. Image source: The Motley Fool.

Finally, PREIT (PEI) recently stated that it is in negotiations to buy three Macy's stores. At one mall, PREIT hopes to bring in a replacement department store. At the other two (both located in the Philadelphia suburbs), PREIT is looking for non-traditional mall tenants, in order to transform those malls into "lifestyle centers" focused as much on entertainment as shopping.

Assuming that Macy's and PREIT are able to come to terms (which is almost certain), this portfolio should sell for more than the $5 million CBL portfolio. After all, two of the three properties are in a major metropolitan area.

Most stores in the top malls are staying put

In total, Macy's fourth-quarter real estate sales are on pace to bring in $400 million to $500 million. That's less than what I projected. On the other hand, most of the stores being closed are in low-performing malls (and others are leased rather than owned by Macy's). The only real disappointment is that the Minneapolis flagship building didn't fetch a higher price.

The top 150-200 properties in Macy's real estate portfolio (out of its more than 700 locations) account for the vast majority of its real estate value. However, these stores are strongly profitable despite the company's recent struggles.

If the right deal came along, Macy's would probably sell its top-performing stores. For now, it makes more sense to operate them. If conditions change, there would surely be opportunities to monetize this valuable real estate in the future.