The X class was a World War II midget submarine class built for the Royal Navy during 1943–44.
Known individually as X-Craft, the vessels were designed to be towed to their intended area of operations by a full-size 'mother' submarine - (usually one of the T class or S class) - with a passage crew on board, the operational crew being transferred from the towing submarine to the X-Craft by dinghy when the operational area was reached, the passage crew returning with the dinghy to the towing submarine. Once the attack was over, the X-Craft would rendezvous with the towing submarine and then be towed home. Range was limited primarily by the endurance and determination of their crews, but was thought to be up to 14 days in the craft or 1,500 miles (2,400 km) distance after suitable training. Actual range of the X-Craft itself was 500 nmi (930 km) surfaced and 82 nmi (152 km) at 2 knots (3.7 km/h) submerged.
The craft was about 51 feet (15.5 m) long, 5.5 feet (1.68 m) in maximum diameter and displaced 27 tons surfaced and 30 tons submerged. Propulsion was by a 4-cylinder Gardner 4LK  42 hp diesel engine, converted from a type used in London buses, and a 30 hp electric motor, giving a maximum surface speed of 6.5 knots (12 km/h), and a submerged speed of 5.5 knots (10.1 km/h). The crew initially numbered three—commander, pilot and ERA (Engine Room Artificer, i.e. engineer) but soon a specialist diver was added, for whom an airlock, known as a wet and dry compartment, was provided. The ERA, usually a Navy Chief Petty Officer, operated most of, and maintained all of, the machinery in the vessel.
The weapons on the "X-Craft" were two side-cargoes - explosive charges held on opposite sides of the hull with two tons of amatol in each. The intention was to drop these on the sea bed underneath the target and then escape. The charges were detonated by a time fuse.
The craft were fitted with electro-magnets to evade detection by anti-submarine detectors on the sea bed.
A number of development craft were built before it was felt that a feasible weapon had been produced. The first operational craft was X3 (or HM S/M X.3), launched on the night of 15 March 1942. Training with the craft began in September 1942, with X4 arriving in October. In December 1942 and January 1943 six of the "5-10" class began to arrive, identical externally but with a completely reworked interior.
These operations were part of a longer series of frogman operations, see human torpedo.
The operational base and training establishment was HMS Varbel at the former Kyles Hydro Hotel at Port Bannatyne on the Isle of Bute in the Inner Hebrides of Scotland. Their first deployment was Operation Source in September, 1943, an attempt to neutralise the heavy German warships based in Northern Norway. Six X-Craft were used, but only 2 successfully laid charges (under the German battleship Tirpitz); the rest were lost, scuttled or returned to base. Tirpitz was badly damaged and out of action until April 1944.
This was the only multiple X-craft attack. The lost craft were replaced early in 1944 with X20 to X25 and six training-only craft.
On 15 April 1944 X24 attacked the Laksevåg floating dock at Bergen. X22 was intended for the mission, but had been accidentally rammed during training and sunk with all hands. X24 made the approach and escaped successfully, but the charges were placed under Bärenfels, a 7,500 ton merchant-vessel along the dock, which was sunk; the dock suffered only minor damage. On 11 September 1944, the operation was repeated by X24, with a new crew; this time the dock was sunk.
X20 and X23 acted as lightships to help the D-Day invasion fleet land on the correct beaches (Operation Gambit), as part of the Combined Operations Pilotage Parties (COPP).
X24 is the only remaining intact example of an X-Craft. It can be found in the Royal Navy Submarine Museum.
Operations continued in the Far East with the revised XE class submarines.