Every investor has different timelines and goals, and the stocks they select to fill a portfolio should mirror those goals. While some may not care about dividends, others value them highly, even if it means giving up some gains to the broader market. That's the camp AT&T (T -0.52%) investors find themselves in, as its incredible 7.9% yield is among the best in the market.

So should you buy AT&T stock? Read on to find out two reasons you might want to -- and one reason you should avoid it.

Reason to buy No. 1: The yield is high and safe

AT&T is the largest telecom provider in the U.S. The telecom industry has essentially transformed into a utility, as nearly everyone has a phone and will continuously pay their bill, regardless of what happens with their job.

As a result of its highly dependable cash flow, the company can pay an above-average dividend, as management has high visibility on what each quarter will bring. However, many investors have been taught that once a dividend yield rises about 4% to 6%, there's something wrong with the company and the yield isn't sustainable. Despite AT&T's near-8% yield, that's not the case.

The dividend payout ratio measures how safe a dividend is, as it takes the amount paid out to investors divided by an earnings metric like earnings per share (EPS) or free cash flow (FCF). This percentage shows how much of a company's earnings are devoted to the dividend. It's usually considered safe if it is below 50% for regular companies and 70% to 80% for utility companies.

During the second quarter, AT&T's payout ratios were quite safe.

Metric Amount Payout Ratio
Dividends paid $2.08 billion N/A
Free cash flow $5.65 billion 37%
Net income $4.49 billion 46%

Data source: YCharts.

So with AT&T's dividend looking safe, why has the yield reached that high?

Reason to buy No. 2: The stock is cheap

Investors can get yield through different assets (bank accounts and Treasuries), so they no longer need to look at riskier assets like stocks for yield. As a result, companies like AT&T that were only bought for yield have been sold off relentlessly.

In the dividend yield calculation, if the dividend payout stays the same and the stock price drops, the yield rises. This is precisely what has happened to AT&T's stock, although it may have been done to an extreme level.

AT&T's price-to-FCF ratio has nearly reached a two-decade low, telling investors it's drastically undervalued.

Chart showing AT&T's price to free cash flow down in 2023.

T Price to Free Cash Flow data by YCharts

Because of its low price, investors shouldn't fear the stock's price tag.

While both reasons to buy sound good, there may be another reason to avoid the stock altogether.

Reason to avoid No. 1: You like beating the market

There's no doubt about it -- if you've owned AT&T stock for any meaningful period, you've likely lost to the market. AT&T has historically underperformed the market by a significant margin in nearly every reasonable time frame (three to five years), even when dividends are added back in.

Chart showing the S&P 500 beating AT&T's total return since 2020.

T Total Return Level data by YCharts

So if you're a younger investor and growing your portfolio balance is critical, avoiding AT&T stock (even though it has an excellent yield) is smart. But if you're older and just looking for a nice steady income at a level you're comfortable with, AT&T may be a decent stock for you.

It all comes down to expectations and goals; not everyone's are the same.