President Trump castigated the leaders of NATO allies to their faces during his trip to Europe this week, suggesting that many of them “owe massive amounts of money” to the alliance. Mr. Trump has a point, but he mischaracterizes the way it works.

What is Mr. Trump’s complaint?

“NATO members must finally contribute their fair share and meet their financial obligations, for 23 of the 28 member nations are still not paying what they should be paying and what they’re supposed to be paying for their defense,” he said.

Yes and No. NATO has a budget to cover common civilian and military costs, and some NATO-owned assets are also commonly funded when they are used in operations. The United States pays 22 percent of those costs, according to a formula based on national income. None of the NATO allies are in arrears on these contributions.

Mr. Trump is referring imprecisely to a goal NATO has set for each member to spend at least 2 percent of its gross domestic product on its own defense each year. He is correct that only five of the 28 members currently meet that goal, and they are the United States, Greece, Britain, Estonia and Poland.