(CNN) Yes, peanut butter can be a nutritious diet staple, but some varieties are healthier than others.

Peanut butter is rich in heart-healthy fats and is a good source of protein, which can be helpful for vegetarians looking to include more protein in their diets. A 2-tablespoon serving of peanut butter contains up to 8 grams of protein and 2 to 3 grams of fiber. The nutty spread also offers vitamins and minerals including the B vitamin niacin, iron, potassium and vitamin E.

The healthiest peanut butter is made from just peanuts, while added salt, sugars and oils change its nutritional profile. For example, a peanut butter with salt added can have 100 to 150 milligrams of sodium, while an unsalted version is sodium-free. Sugars may be added too, especially in flavored varieties, and can contribute up to 7 grams, or 28 calories per serving.

Nuts, including peanuts (which are technically legumes), have been associated with lower risk of heart disease , cancer and premature death.

Consumption of nuts and peanut butter has also been associated with reduced risk of type 2 diabetes . However, one study that tracked more than 120,000 men and women from 1986 to 1996 found that while consumption of nuts and peanuts was associated with lower mortality rates among individuals, no protective effect was found for peanut butter

"In the past, it has been shown that peanut butter contains trans fatty acids and therefore the composition of peanut butter is different from peanuts. The adverse health effects of salt and trans fatty acids could inhibit the protective effects of peanuts," researchers wrote in a news release on the study.

In fact, a 2001 USDA report found that peanut butter does not contain any detectable levels of trans fats in any of the 11 brands of peanut butters that researchers tested , which included both major store brands and "natural brands," even though small amounts of hydrogenated vegetable oils are added to commercial peanut butters to prevent the peanut oil from separating out.

Though it might seem that crunchy or chunky peanut butter might have an edge over the smooth kind, nutritionally speaking, they are pretty similar. Differences among peanut butters have more to do with a spread's ingredients, rather than its texture.

Linda V. Van Horn, professor of preventive medicine and a registered dietitian at Northwestern University, stated that commercial peanut butter formulations have been improved because the food industry is aware of the trans fat issues and has responded by reformulating those products. "Just remember to check the label for '0' trans fats and preferably '0' added sugars," she said. Fortunately, "there is no concern with ground-up peanuts ... otherwise known as 'natural' peanut butter."

Follow CNN Health on Facebook and Twitter See the latest news and share your comments with CNN Health on Facebook and Twitter.

Keep in mind that most of the calories in peanut butter come from fat. While it's mostly the heart-healthy monounsaturated and polyunsaturated kind, it does make peanut butter a calorie-dense food. A 2-tablespoon serving has approximately 200 calories, so if you are carefully watching calories, you can cut that portion in half. And steer clear of flavored peanut butters with added sugars and cocoa butter, which morphs a healthy nut spread into dessert.