I-40 was laid down on 18 March 1942 at the Kure Navy Yard at Kure, Japan, with the name Submarine No. 370.[1] Renamed I-40 on 20 August 1942 and provisionally attached to the Yokosuka Naval District that day,[1] she was launched on 10 November 1942.[1] She was completed and commissioned on 31 July 1943.[1]
Upon commissioning, I-40 was attached formally to the Yokosuka Naval District and assigned to Submarine Squadron 11 in the 1st Fleet for work-ups.[1] During August 1943, she took part in testing of sonar and magnetic anomaly detector equipment in the Seto Inland Sea, serving as an antisubmarine warfare target for the minelayer .[1]
With her work-ups completed, I-40 was reassigned to Submarine Division 1 in Submarine Squadron 2 in the 6th Fleet on 31 October 1943.[1] She departed Yokosuka on 13 November 1943 bound for Truk, which she reached on 19 November 1943.[1]
The Gilbert and Marshall Islands campaign began on 20 November 1943 with the U.S. invasion of Tarawa and of Makin in the Gilbert Islands.[1] That day, I-40 and the submarines,,,,,,, and all received orders to proceed to the Gilberts and oppose the invasion.[1] I-40 got underway from Truk on 22 November 1943 to begin her first war patrol, assigned a patrol area off Makin Island.[1] The Japanese never heard from her again.[1]
On 26 November 1943, the 6th Fleet ordered I-40 to join I-19, I-169 and Ro-38 in forming a picket line north of Makin,[1] and on 2 December 1943 it ordered I-19,, and I-40 to report their positions.[1] I-40 did not respond to either message.[1]
The circumstances of I-40′s loss remain a mystery. The destroyer sank a Japanese submarine southwest of Tarawa on 23 November 1943 which probably was I-39 but could have been I-40.[1] It also has been proposed that land-based United States Navy aircraft teamed with the destroyer to sink her[1] and that Radford alone sank her.[1]
On 21 February 1944, the Imperial Japanese Navy declared I-40 to be presumed lost with her entire crew of 97 in the Gilbert Islands area.[1] She was stricken from the Navy list on 30 April 1944.[1]