SM UC-40 was a German Type UC II minelaying submarine or U-boat in the German Imperial Navy (German: Kaiserliche Marine) during World War I. The U-boat was ordered on 20 November 1915 and was launched on 5 September 1916. She was commissioned into the German Imperial Navy on 1 October 1916 as SM UC-40. In 17 patrols UC-40 was credited with sinking 30 ships, either by torpedo or by mines laid. UC-40 was being taken to surrender but foundered in the North Sea en route on 21 January 1919.