This will either be vaguely interesting or generate juicy flaming.
I'll start with the US.
1. Britain (2x)
2. Itself (Civil war)
3. Iraq (2x)
4. Spain
5. North Korea
6. North Vietnam
7. Every single precolonial North American nation within the US's current borders
8. Mexico (2x if you include the independence of Texas)
9. Canada, while it was a British possession
10. Germany (2x)
11. Japan
12. Afghanistan
13. Libya (small engagement)
14. Iran (small engagement)
15. Somalia (small engagement)
16. Haiti (small engagement)
17. Panama (small engagement)
There are some other nations with which US has had some military skirmish. During WW1 the US invaded Russia, but I don't know much about that.
I'm sure I'm missing something.
EDIT: I forgot the Barbary Pirates, so let's say:
13. Libya (2x)
Forgot:
[from Max Boot's The Savage Wars of Peace Small Wars and the Rise of American Power]
Marquesas natives (1813 expedition)
Argentina (1831 destruction of Argentine settlement on falklands in retaliation for them capturing some American fishing boats)
Sumatran Pirates (1830s)
Natives of Fiji, Samoa, and Drummond Islands (1838-1842 expedition)
China (1856 during Second Anglo-Chinese War when a Chinese fort fired on some American ships, we retaliated)
Korea (1871)
Numerous Latin American interventions prior to Spanish American War:
Argentina 1833, 1852, 1890
Peru 1835
Nicaragua 1852, 1853, 1854, 1896, 1899
Uruguay 1855, 1858, 1868
Mexico 1870
Chile 1891
Panama(Colombia) 1860, 1873, 1885, 1895
Boxer Rebels 1900
Filipino Rebels 1899-1902 (over 4000 american deaths)
More Cuba, Dominican Republic, Panama, Nicaragua, and Mexico (1899-1914)
Then you got Haiti (1915-1934) and Dominican Republic (1916-1924)
Pancho Villa 1916-1917
Red Russia 1918-1920
Nicaragua 1926-1933
Various Chinese Warlords(kinda like pirates) 1901-1941
Not listed in the book but you also forgot Utah War(1857-58 in which US government fought Mormons over their desire for an independent country), Grenada (lol), and Serbia(1995) and Bosnia(1999)