Anyone curious about the cost of America’s wars in Iraq and Afghanistan can look it up on costofwar.com, up to the latest fraction of a second. Last weekend, the Iraq war had cost more than $800 billion since 2001; the Afghan war, $467 billion plus.

For the 8-1/2-year conflict in Iraq alone, that works out to nearly $3,000 a second.

So President Obama’s announcement that all US troops will be out of Iraq by year end should mean some drop in ongoing military spending. But the budget relief probably won’t be as much as you might expect.

Tragically, beside the financial cost, there is the human toll. The war in Iraq has resulted in some 4,480 US troops killed and more than 32,000 wounded. (The Iraqis have suffered far more fatalities, about 654,965, according to the British medical journal The Lancet.) Thus, ongoing medical and disability claims and treatment of US veterans will boost the costs of the Iraq war even more.

Throw in the replacement of vehicles, weapons, equipment, etc., and the eventual tab for the United States could reach $4 trillion to $6 trillion, according to University of Columbia economist Joseph Stiglitz and Harvard University budget expert Linda Bilmes. Those are big numbers.

They would be on par with the $4.6 trillion the US spent on the recent financial bailouts, according to Barry Ritholtz, CEO of Wall Street research firm Fusion IQ and author of the popular blog The Big Picture. (Another estimate puts the bailout cost at $8.7 trillion.) The sum spent on the Iraq war could pay for a good chunk of Obamacare, professor Bilnes estimates. It’s more than the $3.6 trillion the US spent to fight World War II, even after adjusting for inflation, Mr. Ritholtz estimates.

Modern warfare is just plain expensive. The military has found ways to reduce the human toll of war (compared with Iraq, fatalities in World War II were far higher: 17 million combatants from some 70 nations, 19 million Soviet civilians, 10 million Chinese, 6 million European Jews, and so on). But political leaders always seem to underestimate the financial costs.

When President George W. Bush launched the war, charging incorrectly that Iraq had weapons of mass destruction, the Pentagon estimated its cost at $50 billion to $60 billion. Economic adviser Lawrence Lindsey got in hot water at the White House when he guessed in public the war could cost as much as $200 billion.

One oddity of the Iraq and Afghanistan wars is that even as military preparations were under way, Congress cut taxes in 2001 and again in 2003. These Bush tax cuts meant in effect that the wars were financed by adding to federal debt, rather than paid for from revenues. US outstanding debt zoomed from $5.7 trillion when Mr. Bush took office to $10.6 trillion when he left. And all but $700 billion of that debt was accumulated before the Wall Street bailouts began under the Troubled Asset Relief Program in October 2008.

Another interesting note: It is estimated Al Qaeda spent roughly half a million dollars to destroy the World Trade Center and damage the Pentagon.

Mr. Obama aims to end the US combat mission in Afghanistan by the end of 2014, more than three years away and after many more billions of dollars will have been spent.

After the end of the Cold War, real US defense spending dropped by 40 percent during the 1990s. The savings were in the hundreds of billions of dollars.

It’s to be hoped that similar savings could be made with the end of the wars in Iraq and Afghanistan. Obama and Congress could then presumably afford to spend more federal money at home rather than abroad ­– and create more jobs for Americans.

– David R. Francis is a former business editor of The Christian Science Monitor.