It's been a good year so far for retailers Walmart (WMT -0.08%) and Target (TGT 0.18%). As of this writing, the two stocks have risen 16% and 21%, respectively, year to date. Both companies reported better-than-expected fourth-quarter results this year. Walmart announced a 3-for-1 stock split, and Target surprised investors with news that it is rolling out a paid tier for its Target Circle loyalty program.

Given both of these stocks' moves higher, Walmart and Target must be doing something right. This is why it's a good time to take a look at the two companies to see if their shares are attractive today. More specifically, let's see if one of these two stocks is more attractive than the other at their current prices.

Walmart expects its strong growth to continue

High interest rates have done little to slow Walmart down. The company's full-year revenue increased 6% year over year, and revenue during its important fourth quarter rose 5.7%. Additionally, the company's e-commerce sales continue to be a particularly bright spot, growing 23% year over year during Q4.

Beyond these key metrics regarding Walmart's core business, the company also boasts a fast-growing advertising business. Walmart's Q4 global advertising sales climbed 33% year over year.

Given Walmart's impressive broad-based momentum, it's not surprising that the stock trades at a premium valuation of about 32 times earnings. Not only is Walmart growing at a rapid clip given how big the retailer already is, but it's doing this during a period in which high interest rates are pressuring customers.

Target is turning things around

Though Target shares have outperformed Walmart this year, its underlying business isn't doing as well. Q4 revenue grew just 1.7% year over year, and full-year 2023 sales declined 1.7% year over year.

What's notable about Target's recent business performance is how things have improved recently. The company's Q4 top-line growth was a big change from a 4.2% year-over-year revenue decline during Q3.

Target's strong execution as it exited the year wasn't limited to revenue growth. Target's Q4 adjusted earnings per share rose 57.6% year over year to $2.98 -- crushing management's guidance for earnings per share during the period to be between $1.90 and $2.60.

In its Q4 earnings release, Target CEO Brian Cornell commented on the company's turnaround: "Our team's efforts changed the momentum of our business, further improving our sales and traffic trends in the fourth quarter while driving profitability well ahead of expectations."

As the icing on the cake, Target even recently announced a new paid tier to its loyalty program, essentially creating a new revenue stream. Priced at a promotional rate of $49 for the first year of membership, the new program will give members access to one-day and two-day shipping services.

Target stock has the cheaper valuation of the two, with a price-to-earnings ratio of about 19.

Which retailer's stock is a better buy?

It's tempting to recommend Target, with its cheaper valuation and a business that is turning around. But Walmart's demonstrated resilience in 2023 and its strong momentum going into 2024 justify its stock's higher valuation. At the two stocks' current valuations, Walmart stock looks like the better buy. But Target stock looks fairly attractive at its current valuation, too.