U-21 may refer to one of the following German submarines:
- SM U-21 (Germany), was a Type U 19 submarine launched in 1913 and that served in the First World War; sank HMS Pathfinder, the first ship sunk by a torpedo fired from a submarine; U-21 sank on 22 February 1919 while en route to be surrendered
- During the First World War, Germany also had these submarines with similar names:
- SM UB-21, a Type UB II submarine launched in 1915 and surrendered 24 November 1918
- SM UC-21, a Type UC II submarine launched in 1916 and lost in September 1917
- During the First World War, Germany also had these submarines with similar names:
- German submarine U-21 (1936), a Type IIB submarine that served in the Second World War; stricken on 5 August 1944 and scrapped in February 1945
- German submarine U-21 (S170), a Type 206 submarine of the Bundesmarine that was launched in 1974 and scrapped in 1998