The conflicts in Iraq and Afghanistan has been costing the US dearly, both in terms of personnel and money. After adjustments for inflation, the war on terror cost has gone well over a trillion US dollars, making it second only to World War II. The Congressional Research Service's report - Cost of Major US Wars, has compared war costs right from the American Revolution till date. In this 2½ millennium period, the World War II has been the most expensive at around $300 billion, and when converted into present dollar terms, amounts to over $4 trillion. The United States has now spent around $1.15 trillion on the war on terrorism, making it the second most expensive ever. The Vietnam War had cost the United States of America around $700 billion in today's terms.
However, the comparison is not so straightforward. World War II managed to eat up a whopping 36% of the United States GDP, while the war on terrorism has just taken around 1% of the US GDP. There are many other factors that differ with time, that make the comparison extremely difficult.
Even the CRS report suggests the same. The reports says, "One problem is how to separate costs of military operations from costs of forces in peacetime. In recent years, the DOD (Department of Defense) has tried to identify the additional 'incremental' expenses of engaging in military operations, over and above the costs of maintaining standing military forces. Figures are problematic, as well, because of difficulties in comparing prices from one vastly different era to another. Perhaps a more significant problem is that wars appear more expensive over time as the sophistication and cost of technology advances, both for military and for civilian activities."
Nevertheless, whether the conflicts are achieving their objective is another matter, but the Global War on Terror cost will go much higher in the near future. According to an estimate in the year 2007 made by the Congressional Budget Office, by 2017, the engagements in Iraq and Afghanistan could cost the United States up to $2.4 trillion.