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)
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)