German submarine U-1231 was a Type IXC/40 U-boat built for Nazi Germany's Kriegsmarine during World War II.
The submarine was powered by two MAN M 9 V 40/46 supercharged four-stroke, nine-cylinder diesel engines producing a total of 4,400 metric horsepower (3,240 kW; 4,340 shp) for use while surfaced, two Siemens-Schuckert 2 GU 345/34 double-acting electric motors producing a total of 1,000 shaft horsepower (1,010 PS; 750 kW) for use while submerged.
About three months later she was commissioned into service under the command of Kapitän zur See Hermann Lessing (Crew 21) in the 31st U-boat Flotilla on 9 February 1944.
The U-boat left Bergen on 18 October 1944 for the first war patrol operating unsuccessfully against Allied shipping in the North Atlantic and off the coast of Canada.
After returning to Flensburg on 5 February 1945, Lessing was relieved as commander by Oberleutnant zur See Helmut Winke (Crew X/39).