It's been a neck-and-neck race between Johnson & Johnson (JNJ 1.49%) and AbbVie (ABBV 1.06%) stocks so far in 2017. The two healthcare stocks are up by nearly identical levels year to date. And that's despite revenue headwinds for J&J and strong sales growth for AbbVie.

Which of these two stocks is the better buy right now? The primary criteria for investors to grade the companies on include current products, growth prospects, dividend strength, and valuation. Here's how Johnson & Johnson and AbbVie compare.

Woman weighing options with hands out with chalk drawing of scale behind her

Image source: Getty Images.

Current products

Johnson & Johnson is basically three huge healthcare businesses rolled into one. None of them, though, is growing at impressive rates. J&J's consumer segment's revenue increased only 1.7% year over year in the second quarter. Medical devices performed better, with sales 4.9% higher than the prior-year period. However, the company's pharmaceuticals segment is struggling, with revenue slipping slightly in the second quarter compared with the same period in 2016.

What's going on with J&J's pharmaceuticals group? The biggest problem is that sales for its top-selling drug, Remicade, are falling as a result of competition from a new biosimilar. Although several other top drugs are performing exceptionally well, especially cancer drugs Darzalex and Imbruvica, the drag from Remicade is too much to offset.

AbbVie, on the other hand, continues to enjoy solid growth from its top product, Humira. The big biotech also makes more money off Imbruvica than J&J does. There have been mixed results for AbbVie's other products, but because their sales are low relative to Humira, the company is in great shape overall. 

Winner: AbbVie. 

Growth prospects

Johnson & Johnson has been busy buying other businesses to fuel its growth. Just this year, the company acquired Abbott Labs' (ABT 1.91%) medical optics unit and Swiss drugmaker Actelion. J&J also should continue to benefit from growth from several of the drugs in its current lineup. It also recently won approval for promising psoriasis drug Tremfya.

In addition, the healthcare giant's pipeline includes nearly 30 late-stage programs. Several of those are pursuing additional indications for already-approved drugs such as Darzalex and Xarelto. However, J&J also has new candidates in the development, including experimental prostate cancer drug apalutamide. Wall Street analysts project that the company will grow earnings by 6% annually over the next few years. 

AbbVie hasn't made any big deals so far this year, but its past acquisitions activity has added several strong products to its pipeline. Perhaps the most important of these is experimental cancer drug Rova-T, which AbbVie picked up with its acquisition last year of Stemcentrx.

The company's pipeline also includes several other candidates with blockbuster sales potential. Elagolix is in late-stage studies for treating endometriosis and uterine fibroids. AbbVie has two promising late-stage autoimmune-disease candidates with risankizumab and upadacitinib. Thanks to expectations of sustained momentum for Humira and Imbruvica and these new products potentially on the way, Wall Street estimated AbbVie will grow earnings by more than 14% annually over the next five years.

Winner: AbbVie.

Dividends written on tab held up by twig next to roll of money

Image source: Getty Images.

Dividend

Johnson & Johnson has been a longtime favorite for dividend investors. Its dividend currently yields 2.5%. J&J uses around 54% of earnings to fund the dividend program. The company has increased its dividend for 54 consecutive years.

AbbVie is also attractive when it comes to dividends, with a 3.54% yield. The biotech uses roughly 61% of earnings to fund its dividend. And if you count the period where AbbVie was part of its parent Abbott Labs, the company claims a track record of 45 years in a row of dividend increases.

Winner: AbbVie. 

Valuation

Johnson & Johnson stock trades at just under 18 times expected earnings. AbbVie's shares trade at a little over 11 times expected earnings.

Winner: AbbVie.

Better buy

Based on the criteria we've examined, it's pretty clear that AbbVie emerges as the better pick right now. However, Johnson & Johnson has been a great stock to own in past years and is likely to continue its winning ways into the future.

The primary challenge for AbbVie is one that J&J is already facing: the threat of biosimilar competition for its top-selling drug. AbbVie is fighting in court to prevent biosimilars from entering the market. The company thinks it can hold off competition in the U.S. through 2022. If it's able to do so, that should give AbbVie ample time for its pipeline candidates to step up.