PHILADELPHIA — Video-shopping network QVC and the Home Shopping Network will merge in an effort to better compete against Amazon and Wal-Mart, as more consumers stop watching cable TV and do their shopping online.

The combined company will be the third-largest U.S. electronics retailer and will be big enough to be listed on the Standard & Poor’s 500 index, according to Greg Maffei, CEO of Liberty Interactive Corp., the holding company built by cable TV pioneer John Malone that controls QVC.

QVC, based outside Philadelphia, plans to acquire the 62 percent of St. Petersburg, Florida-based HSN it doesn’t already own, the companies said Thursday. Denver-based Liberty is to be renamed QVC Group after the deal’s scheduled closing later this year. QVC boss Mike George will run both brands, including the three QVC channels and the two HSN channels and their online and mobile shopping services.

The companies plan to cut at least $75 million in yearly spending by eliminating any duplication in management, administrative and information technology spending, Maffei told investors.

Two years ago, QVC, which employs more than 4,000 workers in southeastern Pennsylvania, bought Seattle-based mobile-shopping network Zulily.

The all-stock purchase announced Thursday is valued at $2.1 billion, or around $40.36 a share. That’s a nearly 30 percent premium to HSN’s recent stock value.