The O 21 class was a class of seven submarines, built for the Royal Netherlands Navy. The boats were still incomplete at the start of the German invasion of the Netherlands, O 21, O 22, O 23 and O 24 were hastily launched and escaped to the United Kingdom. O 25, O 26 and O 27 were not able to escape and were captured by the German forces. The Kriegsmarine ordered the completion of the boats and they entered German service as UD-3, UD-4 and UD-5. The submarines' diving depth was .
At the start of the Second World War the O 21 class was together with the British U, S and T classes and German Type VII one of the most advanced submarine classes in service.
The O 21 class submarines were designed by the Dutch engineer G. de Rooy, chief engineer of the Royal Netherlands Navy (RNN) at the time. They were similar to the submarines of the , except the boats had no minelaying capability. The omission of the minelaying capability resulted in a smaller and more streamlined hull which made it possible to reach a higher surface speed. Visually the boats showed many similarities to the German Type VII submarine. The submarines of the O 21 class had a length of , a beam of and a draught of . Above water they had a displacement of 990 tons and submerged they had displacement of 1,205 tons. There was enough space aboard for a crew of 39 to 60 persons.
One of the requirements the RNN set for the O 21 class was that it had to be able to dive deeper than the previous class, which was the O 19 class.
The primary armament of the O 21-class submarines consisted of eight torpedo tubes; four were located at the bow, two at the stern and two external amidships. There was room for a total of fourteen torpedoes, with eight being in the torpedo tubes and six for reloads. Besides the eight torpedo tubes the O 21 class was also equipped with an deck gun, two single-mounted anti-aircraft guns and a single machine gun. The three unfinished boats (O 25, O 26 and O 27) that were captured and later completed by Nazi Germany during the Second World War had besides the eight torpedo tubes, a single 8.8 cm deck gun, and two 20 mm guns.
The O 21-class submarines were equipped with two seven-cylinder two-stroke Sulzer 7 QD 42/50 diesel engines that each could produce and drive the two screws of the submarine to a maximum surface speed of . Besides the two diesel engines, the submarines also had two electric motors that each could produce and two banks of 96 cells batteries with a capacity of 5,350 Ah. This allowed the submarine to operate solely on electric power for five hours. The maximum underwater speed was .
The boats were built by three different shipyards. O 21 and O 22 were built by the Koninklijke Maatschappij De Schelde. O 23, O 24, O 26 and O 27 by RDM and O 25 at the Wilton-Fijenoord shipyard.
Equivalent submarines of the same era