Submarines of World War II represented a wide range of capabilities with many types of varying specifications produced by dozens of countries.
The principle countries engaged in submarine warfare during the war were Germany, Italy, Japan, the United States, United Kingdom and the Soviet Union.
The Italian and Soviet fleets were the largest.
While the German and US fleets fought anti-shipping campaigns (in the Atlantic and Pacific respectively), the British and Japanese submarines were mostly engaged against enemy warships.
[1]