When the stock market hits rough seas, you may wonder about the safety of your dividends. The S&P 500 has fallen by about 18% in 2022 due to a host of concerns such as the Federal Reserve raising interest rates and fears about an economic slowdown.

Fortunately, with these two stocks, you can rest easy that your payments will continue, no matter what goes on with the economy and markets. That's because these two companies tend to do well regardless of the economic environment -- continuing to produce free cash flow and pay dividends.

It's time to look more closely at Walmart (WMT -1.80%) and Kimberly-Clark (KMB 5.51%) to understand how they've paid dividends for a long time and likely will continue to do so.

People sitting around a table pointing to a piggy bank.

Image source: Getty Images.

Walmart

Walmart's first-quarter earnings didn't thrill investors, and they sent the stock down by nearly 18% since the mid-May report. While it's difficult to ignore a move of that magnitude, the company remains in a strong competitive position and its dividend prospects haven't dimmed.

Fiscal first-quarter revenue increased by 6.5% to $141.6 billion after excluding foreign currency translation effects and divested businesses. But due to higher expenses, operating income fell by about 20% to $5.3 billion. This covered the period that ended on April 30.

Management can offset higher costs by raising prices to a certain extent, and expects this year's operating income will come in roughly the same as last year. However, Walmart has been laser-focused on keeping costs down and passing these savings along to customers throughout its six-decade existence. While profitability growth may take a temporary hit, consumers will always remain drawn to its low prices.

Looking at Walmart's annual free cash flow, last year it was $11.1 billion, which handily covered the $6.2 billion of dividends. You can also take comfort in Walmart's commitment to dividends. It has raised them annually since first making a payout in 1974, putting it on the cusp of becoming a Dividend King in a couple of years. This includes the board of directors' decision in February to increase quarterly payments by a penny to $0.56.

Kimberly-Clark

Kimberly-Clark makes the types of products that people buy no matter what's going on with their personal finances. These include diapers, wipes, paper towels, and napkins sold under well-established brands like Huggies, Pull-Ups, Kleenex, and Scott. Most of its sales come from selling these items to consumers, with its personal care and consumer tissues segments accounting for about 84% of last year's sales.

The company's recent results show people still want Kimberly-Clark's products. In the first quarter, sales excluding acquisitions rose by 10%. Volume accounted for two percentage points and price increases were another six percentage points. A more favorable product mix was responsible for the remaining amount.

Although higher costs hurt adjusted operating income, which fell by 21.8% to $629 million, the company was able to mitigate the effect by raising prices, which didn't hurt demand, according to management.

Selling everyday necessities, Kimberly-Clark produces a nice amount of free cash flow, including $1.7 billion last year. This covered the $1.5 billion of dividends. In January, the company announced it was raising dividends by $0.02 to $1.16 a quarter. This made it 50 straight years of increases, putting it in the elite Dividend King category.

Walmart, with its everyday low prices, and Kimberly-Clark, with its well-known consumer staple products, have not only paid dividends but raised them for decades. In an ever-changing world, it's nice to find reliable dividend payers.