The US Congressional Research Service recently released a report, Instances of Use of United States Armed Forces Abroad, 1798-2014:
The instances differ greatly in number of forces, purpose, extent of hostilities, and legal authorization. Eleven times in its history the United States has formally declared war against foreign nations. These 11 U.S. war declarations encompassed 5 separate wars: the war with Great Britain declared in 1812; the war with Mexico declared in 1846; the war with Spain declared in 1898; the First World War, during which the United States declared war with Germany and with Austria-Hungary during 1917; and World War II, during which the United States declared war against Japan, Germany, and Italy in 1941, and against Bulgaria, Hungary, and Rumania in 1942.
Some of the instances were extended military engagements that might be considered undeclared wars. These include the Undeclared Naval War with France from 1798 to 1800; the First Barbary War from 1801 to 1805; the Second Barbary War of 1815; the Korean War of 1950-1953; the Vietnam War from 1964 to 1973; the Persian Gulf War of 1991; global actions against foreign terrorists after the September 11, 2001, attacks on the United States; and the war with Iraq in 2003. With the exception of the Korean War, all of these conflicts received congressional authorization in some form short of a formal declaration of war. Other, more recent instances often involve deployment of U.S. military forces as part of a multinational operation associated with NATO or the United Nations.
Barbara Salazar Torreon, who compiled the report, adds:
The list does not include covert actions or numerous instances in which U.S. forces have been stationed abroad since World War II in occupation forces or for participation in mutual security organizations, base agreements, or routine military assistance or training operations. Because of differing judgments over the actions to be included, other lists may include more or fewer instances.
abc news has now provided an interactive that maps the data set here, together with a discussion of the original report.