List of German U-boats

Germany has commissioned over 1,500 U-boats () into its various navies from 1906 to the present day. The submarines have usually been designated with a "U" followed by a number, although World War I coastal submarines and coastal minelaying submarines used the "UB" and "UC" prefixes, respectively. When Germany resumed building submarines in the 1930s, the numbering of the submarines was restarted at 1. The renumbering was restarted at 1 a third time when Germany resumed building submarines in the 1960s.
World War I–era U-boats.
There were some 380 U-boats commissioned into the "Kaiserliche Marine" in the years before and during World War I. Although the first four German U-boats—, , , and —were commissioned before 1910, all four served in a training capacity during the war. German U-boats used during World War I were divided into three series. The "U" designation was generally reserved for ocean-going attack torpedo U-boats. The "UB" designation was used for coastal attack U-boats, while the "UC" designation was reserved for coastal minelaying U-boats.
U-boats.
U-boats designed primarily for deep water service were designated with a "U" prefix and numbered up to 167.
Type U 66 (Type UD).
The Type U 66 submarines were originally constructed for Austro-Hungary as the "U-7" class, but were sold to Germany at the start of WWI.
UB coastal U-boats.
Coastal attack torpedo U-boats were smaller craft intended for operation closer to land. They were designated with a "UB" prefix and numbered up to 154. 
UC coastal minelaying U-boats.
Coastal minelaying U-boats were smaller vessels intended to mine enemy harbors and approaches. They were designated with a "UC" prefix and numbered up to 105.
Type UC III.
Thirty-five Type UC III submarines were planned, but only 26 were completed. Nine of these ("UC-106" to "UC-114") were never commissioned and were awarded to the United Kingdom and France and broken up in 1921.
Foreign U-boats.
At the outbreak of World War I Germany took charge of a number of submarines under construction in German shipyards for other countries.
World War II U-boats.
In the World War II era, Germany commissioned some 1,250 U-boats into the "Kriegsmarine."
Type X (XB).
Originally intended as long-range minelayers, the Type X were later used as long-range cargo transports. 
Type XI.
The Type XI was a planned artillery boat, armed with four 128-mm guns in two twin turrets along with an Arado Ar 231 floatplane. Four boats were laid down in 1939 but were cancelled at the outbreak of WWII.
Type XIV.
The Type XIV submarine was a shortened version of the Type IXD and used as tankers. Twenty-four were planned, but only 10 were commissioned; three ("U-491" to "U-494") were cancelled before completed and eleven were never laid down. This type was nicknamed "Milchkuh" (milk cow).
Type XVII.
Type XVIIB.
Twelve Type XVIIB submarines were planned, but only three were completed; three were cancelled at the end of the war before completion and six were cancelled in favor of the Type XXI submarine.
Type XVIII.
The Type XVIII was a projected attack boat using the Walter propulsion system. Two boats were laid down in 1943, but construction was cancelled in March 1944.
Midget submarines.
"Seehund" (Type XVIIB).
The range of "U-5000" to "U-6442" was specifically allocated to German midget submarines. The following "Seehund" Type XXVIIB U-boats were entered into the Kriegsmarine registry as commissioned vessels
Foreign U-boats.
Germany captured and commissioned 14 submarines from six countries into the "Kriegsmarine" during World War II.
Turkey
United Kingdom
Norway
Netherlands
France
Italy