SM UB-31 was a German Type UB II submarine or U-boat in the German Imperial Navy (German: Kaiserliche Marine) during World War I. The U-boat was ordered on 22 July 1915 and launched on 16 November 1915. She was commissioned into the German Imperial Navy on 25 March 1916 as SM UB-31. The submarine sank 27 ships in 25 patrols. UB-31 was depth charged and sunk by British warships , , and in the English Channel on 2 May 1918. Alternatively she may have been sunk by a mine on that date.