Commissioned as improved engines were being developed for her class, S-31 was ordered to New London, Connecticut, toward the end of the summer of 1922 for alterations to her main propulsion machinery by the prime contractor, the Electric Boat Company.
She took part in exercises in the Aleutian Islands during June and July 1923 and then moved to the Panama Canal area and the Caribbean for Fleet Problems during the winter of 1924.
In 1925, Submarine Division 16 was transferred to the United States Asiatic Fleet, and S-31 departed San Francisco in April 1925, bound for the Philippine Islands.
For the next seven years, she conducted patrols and exercises in the Philippines during the fall and winter months and deployed to the China coast for spring and summer operations.
In September 1930, S-31, while engaged in a full-power run off China between Qingdao and Qinhuangdao, surfaced amidst wreckage in heavy seas in the Gulf of Zhili and sighted a Chinese junk which had collided with a steamer.
S-31′s crew threw lines to the two remaining survivors, and they were hauled aboard S-31 as the rough seas propelled loose wreckage toward her hull.
On 2 May 1932, S-31 completed her tour in the Asiatic Fleet and departed Manila bound for Pearl Harbor, Hawaii, wher she was based with her division until 1937.
Recommissioned at Philadelphia on 18 September 1940 and assigned to Submarine Division 52, S-31 operated from New London until December 1940, then moved south to the Panama Canal Zone.
By the end of June 1942, S-31 was en route to the Territory of Alaska, and, on 7 July 1942 she departed the submarine base at Dutch Harbor on Amaknak Island off Unalaska in the Aleutians for her first war patrol.
The accident underscored for the U.S. Navy the need for pharmacist's mates to serve aboard S-boats and for better communications between Dutch Harbor and ships operating in the northern Pacific Ocean.
Inclement weather and sporadic communication, which resulted in two mistaken attacks on S-31 by American aircraft, provided the greatest hazards to S-31 during her fourth patrol, conducted between 26 August and 28 September 1942 in support of the occupation of Adak.
On 28 August, a U.S. Navy PBY Catalina flying boat depth-charged her as she crash-dived to 125 feet (38 m) in the Pacific Ocean 30 nautical miles (56 km; 35 mi) southeast of Agattu at 51°53′N 174°27′E / 51.883°N 174.450°E / 51.883; 174.450.
[1] On 30 August, poisonous chlorine gas formed when seawater driven by a 40-knot (46 mph; 74 km/h) wind entered her forward battery compartment.
On the morning of 26 October 1942, she closed the coast of Paramushiro, and at 08:25 she sighted the Japanese 2,864-gross register ton cargo ship Keizan Maru in Otomae Bay and began an approach.
The PPI originally was intended for Admiral William F. Halsey's flagship, the battleship USS South Dakota (BB-57), but crewmen from the S-31 appropriated it for their own use, and it proved remarkably useful during her eighth war patrol.
[3] On 22 August 1943, she began her eighth and last war patrol, conducted in the St. George Channel area to intercept Japanese traffic between Rabaul and New Guinea.