Amazon (AMZN 3.47%) and Target (TGT 0.27%) are two of my favorite retail stocks, so making a choice between them will be difficult. But I'm ready for the challenge.

Both companies have successfully grown and adapted to become big winners in the changing world of retail. Amazon has diversified beyond online sales of general merchandise into grocery and convenience stores, delivery services, online streaming of video and audio as well as cloud computing services. The company has used technology and leveraged services to improve its offerings to customers. For some customers of its membership program, Prime, Amazon offers delivery within two hours.

Target's business isn't as broad as Amazon's, but both do serve customers shopping for general merchandise and groceries. Online sales have been growing by double digits at Target, and like Amazon, the company has made efforts to streamline delivery to customers. Just this month, Target said it would buy Deliv, a company focused on last-mile delivery technology. 

But to discern which stock is the best buy right now, it might be helpful to take a look at how each company is navigating the economic effects of the coronavirus pandemic.

A mini shopping cart with a face mask on it is shown on the keyboard of a laptop.

Image source: Getty Images.

Amazon's demand surges, but so does its spending

Amazon is one of the few retailers that actually saw demand surge as the outbreak necessitated government requests for most consumers to stay home. The company said it needed to hire more than 175,000 workers to keep up with it. In the first quarter, net sales climbed 26% to $75.7 billion.

Amazon Web Services (AWS), the company's cloud computing business, posted a 33% gain in sales -- and the pandemic clearly has added to demand for cloud-related services. For example, the U.K. is using AWS to analyze hospital occupancy levels and related data, and the World Health Organization is using AWS to aggregate epidemiological information from various countries.

Amazon didn't break out sales figures for its grocery delivery service in the first quarter, but the fact that it's boosting the service's capacity indicates that demand is there. The company expanded Whole Foods Market grocery pickup from about 80 stores to more than 150, and in some locations put in place a plan to focus exclusively on preparing online orders during certain hours. In the previous quarter, Amazon Fresh and Whole Foods Market delivery orders more than doubled year over year.

But like its peers, Amazon is facing significant expenses due to the pandemic. The company said it will spend all of its operating profits -- $4 billion or more -- in the next quarter on vital needs such as maintaining employee safety, cleaning of its facilities, and assuring deliveries to customers in a way that allows social distancing.

The impact of the coronavirus -- positive or negative -- aside, Amazon's growth picture is encouraging. The company's annual revenue has been climbing for more than a decade. AWS, which accounted for about three-quarters of the company's total operating income in the first quarter, has seen a bit of a slowdown but not enough to be worrisome. Back in 2018, it posted quarterly sales gains of as much as 49%. With sales increases of more than 30% each quarter over the past year, AWS still looks like a strong contributor to Amazon's growth well into the future. 

Target's higher-margin sales fall, but e-commerce grows

Target also saw a rise in demand in recent weeks, but it may not have fared as well as Amazon for one reason. Target relies on higher-margin items like apparel and accessories, and sales in those categories fell. Management has warned that, because of this, profit may be lower when it reports earnings on May 20.

That said, once the coronavirus pandemic wanes and consumers return to work, sales of apparel and nonessential items are likely to recover. And at the same time, consumers who have lost their jobs or whose incomes have declined will appreciate Target's lower prices compared to department and specialty stores.

Another plus for Target is the company's progress in e-commerce. In 2019, Target increased digital sales by 29% -- and that was its sixth straight year of e-commerce growth surpassing 25%. And sales through its order pick up, drive up, and shipping channels grew more than 90% last year. Post-crisis, shoppers still may favor ordering online, and Target is prepared for that.

While expanding in areas like digital sales and order pickup, Target also has managed to lift its sales, posting annual revenue growth since 2017. And the retailer has surpassed analysts' earnings per share estimates for the past four quarters. 

All of these factors -- e-commerce performance, annual sales gains, and a record of surpassing analysts' estimates -- make me optimistic about Target's future once the worst of the coronavirus impact has passed. 

Which is the better buy?

If you had asked me this question in March, my answer would have been Target. Its share price was down 29% for the year, offering a great entry point. Its stock price has since rebounded and is down only about 6.3% year to date. Though I believe Target's stock price will move higher from here, I expect there will be a few dips down the road as we more clearly understand the economic impact of the coronavirus pandemic. And it's during one of those dips that I would ber inclined to pick up the stock. 

As we all know, Amazon shares aren't exactly cheap -- the stock is trading at 115 times trailing-12-month earnings. Shares are up 30% this year, and Wall Street analysts predict they can move about 10% higher from here over the next 12 months. But I'm looking well beyond 12 months. I think investors who buy shares of Amazon now and hold onto them will benefit years into the future. I like the revenue growth we've seen year after year, the annual performance of AWS, and Amazon's efforts to assure its spot in the online grocery market. These factors lead me to believe the shares will continue to climb, making an investment now worth it despite the premium pricing. 

So, if you must choose between these retail companies, you may want to hop on the Amazon train now -- and pick up shares of Target later.