Target TGT and Wal-Mart Stores WMT were relative late-comers to e-commerce, each only getting serious about the channel in the last few years.

They paid a hefty price for that tardiness, losing market share to online retailers like Amazon.com AMZN and nimbler brick-and-mortar competitors. While they both still have a lot of catching up to do—each retailer gets about 3% of sales through digital commerce, compared to 6% of retail being online industrywide—they have made huge strides. In the most recent holiday quarter, digital sales at Target rose 40%, while those at Walmart jumped 18%.

Both companies will continue to pour a fortune into their e-commerce horsepower. Target last week said it would spend $1 billion this fiscal year on beefing up its digital capabilities—as much as it is spending on its 1,800 stores and expects e-commerce sales to rise 40%.

As for Walmart, CEO Doug McMillon said the holiday season performance was “solid, but not quite as strong as we wanted” (in the year-earlier quarter, e-commerce had grown 30% at Wal-Mart) and will redouble his company’s efforts on that front. Wal-Mart, whose U.S. sales are four times greater than Target’s, plans to spend about $2 billion on e-commerce this fiscal year. Both companies are also preparing for the next frontier in e-commerce, such as same-day delivery.

In a research note on Wednesday by Cowen & Co, analyst Oliver Chen and his team gave Target a slight edge over Wal-Mart thanks to its lead in mobile commerce (shopping and purchasing done via a smartphone) though he warned Wal-Mart was a strong competitor. (Wal-Mart, which gets more than half of its sales from grocery, is already testing grocery pickup for orders placed online. For Target, that will come later because it will spend the next year or so updating its food offerings, which currently generate one-fifth of sales. Food is one of the least underdeveloped areas for e-commerce.)

“Target’s more nimble size allows agility to drive sustainably higher online growth,” Cowen analysts wrote.

Earlier this month, Fortune detailed the missteps Target has made in recent years that ultimately hurt its cachet and made it an e-commerce laggard. But Cowen’s survey of 2,500 customers at each chain showed how much goodwill there still is for Target, meaning a successful digital execution can be a boon. (Chen raised his price target for the company to $90 from $85 on the assumption Target will succeed.) The survey found 81% of Target customers are satisfied with the shopping experience there, compared to 71% at Walmart. But satisfaction among Target customers has slipped in recent years, most notably among consumers making more than $100,000, hence the focus on e-commerce.

Here is a closer look at Cowen’s findings:

Target:

– more and more people browsing online or on their phones are actually buying things now: “conversion,” as that phenomenon is known among retail nerds, rose 7.4 percentage points in February compared to a year earlier (though at 29.2%, it is below 35.8% at Walmart);

– Cartwheel, a market-leading coupon clipping app it launched in 2013, has generated $1 billion in sales and is seen as the leader in such apps—and most of the increase in Target’s online surge comes from mobile. Some 40% of all digital orders were placed via a mobile device.

– Target gets 80% of revenue from categories such as household goods and apparel, which lend themselves better to e-commerce than food does, meaning there is a lot of upside for online growth, particularly as it works to improve the stylishness of priority areas like clothes, beauty products and health items.

– Target plans to be able to use 350 stores by October to help fill online orders, and thereby speeding up delivery, compared to 136 now.

– Target is waiving shipping fees for any orders less than $25, something that will squeeze its profit margin, but also pressure Walmart and Amazon.

Walmart:

– Walmart US had 2014 online sales of about $12 billion, not that impressive in percentage terms, but certainly so in dollar terms.

– CEO Doug McMillon has made it a priority to widely expand the assortment at walmart.com to better compete with Amazon. The company this year will focus on doubling the number of items for sale to 10 million kinds of items (including variations by size and color).

– Walmart is planning to open four new facilities dedicated specifically to filling e-commerce orders.

– Walmart launched its Savings Catcher app only in August (allows comparison shopping), but it is growing quickly.

– Walmart has fewer stores equipped to help with shipping online orders than Target, but at 83 super centers, that’s double what it was two years ago.

– Walmart started allowing in-store pickup of online orders six years before Target did.

Still, Cowen gave Target the nod.

“We believe that Target’s scale (IT) information technology investment, combined with a higher HHI (household income) customers demographic will drive faster omni-channel transformation (than at Walmart,)” Cowen said.

But Walmart has the edge in some areas of e-commerce and with its scale, is formidable competition for Target and Amazon, and anyone, frankly.