German submarine U-2542 was a Type XXI U-boat (one of the "Elektroboote") of Nazi Germany's Kriegsmarine, built for service in World War II. She was ordered on 6 November 1943, and was laid down on 10 November 1944 at Blohm & Voss, Hamburg, as yard number 2542. She was launched on 22 January 1945, and commissioned under the command of Oberleutnant zur See Otto Hübschen on 5 March 1945.