Warren Buffett said earlier this year that inflation "swindles almost everybody." He was -- and is -- exactly right. 

What can investors do to fight back against this swindler? Here are three safe dividend stocks to beat inflation.

1. Easterly Government Properties

Easterly Government Properties (DEA) could arguably be viewed as one of the safest dividend stocks on the market. Why? The real estate investment trust (REIT) primarily leases properties to federal agencies. Easterly likes to point out that its cash flow is "backed by the full faith and credit of the U.S. government."

Easterly's stock performance so far this year doesn't make the stock seem all that safe. The REIT's share price has fallen even more than the S&P 500.

Easterly's stock decline, though, reflects concerns about higher interest rates impacting the company's growth prospects. But there's no reason to worry about the underlying business. And Easterly's dividend remains safe and attractive, with a yield of over 6.5%. 

Inflation shouldn't be an issue for Easterly, either. The company's leases have built-in price increases. This lease structure largely insulates the REIT from the impact of inflation over the long term.

2. Johnson & Johnson

Johnson & Johnson (JNJ -0.69%) has long been viewed as a safe-haven stock. The healthcare giant weathered many storms throughout its 136-year history. It certainly helps that J&J markets the kinds of products that people need, regardless of what's happening with the economy.

Unsurprisingly, Johnson & Johnson is handily outperforming the S&P 500 this year. The company's opportunities could be even stronger in 2023 with the planned spinoff of its consumer health unit.

J&J is a dividend-investor's dream. The company ranks as a Dividend King, with 60 consecutive years of dividend increases. Its dividend yield currently tops 2.6%. 

Admittedly, Johnson & Johnson can feel the impact of inflation. The company noted in its Q3 conference call that it lowered full-year operating-margin guidance because of inflationary pressures. However, this reduction was only modest. J&J still has the ability to pass on higher costs to customers much more effectively than most companies do.

3. PepsiCo

PepsiCo (PEP 3.62%) stands out as another dividend stock that offers safety for nervous investors. It's easily beating the market so far this year. 

The company's Frito-Lay business remains its crown jewel and delivered exceptionally strong growth in the latest quarter. But Pepsi's beverages continue to sell briskly, as well.

Pepsi isn't immune to the impact of inflation, with its costs rising due to supply chain issues and higher fuel costs. However, the company has been largely successful this year at passing along price increases to customers.

Like Johnson & Johnson, Pepsi is a Dividend King. The company has increased its dividend for 50 consecutive years. Its dividend yield is a little under 2.6%. This safe dividend stock should continue to be a winner over the long term.