HMS Onyx was an Oberon class submarine of the Royal Navy.
 The Oberon class was a direct follow on of the Porpoise-class, with the same dimensions and external design, but updates to equipment and internal fittings, and a higher grade of steel used for fabrication of the pressure hull.
 As designed for British service, the Oberon-class submarines were 241 feet (73 m) in length between perpendiculars and 295.2 feet (90.0 m) in length overall, with a beam of 26.5 feet (8.1 m), and a draught of 18 feet (5.5 m). Displacement was 1,610 tons standard, 2,030 tons full load when surfaced, and 2,410 tons full load when submerged. Propulsion machinery consisted of 2 Admiralty Standard Range 16 VMS diesel generators, and two 3,000 shaft horsepower (2,200 kW) electric motors, each driving a 7-foot diameter (2.1 m) 3-bladed propeller at up to 400 rpm. Top speed was 17 knots (31 km/h; 20 mph) when submerged, and 12 knots (22 km/h; 14 mph) on the surface. Eight 21-inch (530 mm) diameter torpedo tubes were fitted (six facing forward, two aft), with a total payload of 24 torpedoes. The boats were fitted with Type 186 and Type 187 sonars, and an I-band surface search radar. The standard complement was 68: 6 officers, 62 sailors.
 Onyx was laid down by Cammell Laird on 16 November 1964, and launched on 18 August 1966. During the Onyx's construction there was an explosion which took the life of a shipyard worker and severely wounded communist union leader Barry Williams. The boat was commissioned into the Royal Navy on 20 November 1967. Onyx was ordered after a previous Oberon-class submarine of the same name (laid down by Chatham Dockyard in 1962) was transferred to the Royal Canadian Navy as HMCS Ojibwa before launching in February 1964.
 The first commission of Onyx saw her visit Swansea in South Wales for the investiture of His Royal Highness The Prince of Wales. She also attended the bicentennial celebrations of the United States of America in 1976.
 Onyx was the only non-nuclear submarine of the Royal Navy to take part in the Falklands War.The diesel submarine went south with a special 5 man diving chamber and fully armed with 10 MK 24, 2 Mk 20 and 11 Mk 8 torpedoes 
 Onyx was tasked with providing reconnaissance photographs of enemy installations enforcing the exclusion zone around the Falklands. Her smaller displacement compared to the nuclear submarines also made her ideal for landing SBS and SAS special forces, picked up from Ascension Island, ashore on the islands in shallow waters. The charts used for these landings, however, were made 200 years before the war.
 During one of these missions, Onyx hit an uncharted pinnacle while submerged at 150 feet (46 m) and suffered minor damage to her bow. Another claim is that the damage was inflicted by one of two torpedoes dropped by an Argentine Navy S-2E Tracker from ARA Veinticinco de Mayo operating 70 NM off the Argentine coast, which had been lost by its RN SSN tail. The Tracker S-2 twice detected sub-surface and electronic traces and a MAD contact on 5–6 May while searching for the ARA Alférez Sobral which was out of contact after being hit by Sea Skua missiles launched by Lynx helicopters. 
 Contrary to some reports, after the British cancelled Operation Mikado, there was never a plan to use Onyx to land the SAS in order to destroy Argentina's remaining stockpile of Exocet missiles. Prior to the submarine being damaged the SBS had been embarked to attack a mainland airfield but this operation, too, was cancelled.
 Postwar, Onyx sank the hulk of the landing ship Sir Galahad with a Mk 8 Torpedo after firing two Mk 24 Tigerfish, the second Tigerfish, after a ten-minute delay, at the hulk; both failed to explode  probably due to torpedo battery faults. Sir Galahad had been damaged beyond repair during an Argentine Air Force raid at Fitzroy and Bluff Cove.
 Defence cuts in the UK saw the Royal Navy dispense with its diesel-powered submarines to concentrate on nuclear attack submarines. In 1991, Onyx was decommissioned from the navy. She was then cared for by the Warship Preservation Trust and was on public display alongside several other ships in Birkenhead, UK.
 In May 2006, Onyx was sold to the Barrow-in-Furness businessman Joe Mullen, for a reported £100,000 as a 'gift to the people of Barrow'. She left Birkenhead on 13 June 2006 to form the centrepiece of The Submarine Heritage Centre, a new heritage museum in Barrow-in-Furness, Cumbria, as a celebration to the town's illustrious submarine-building history.
 After the submarine museum went into debt she was taken by an unknown liquidation company as a financial asset, to be broken up for scrap. A small party from HMS Exploit gave her a send off recognising her contribution to the Navy and country in the cold war and Falklands conflict. On 30 April 2014 she was sailed from Barrow in tow for the Clyde and berthed at Rosneath amid continued uncertainty as to whether at least part of Onyx might be preserved. Onyx was alongside Rosneath Jetty on the Gare Loch, Scotland on 18 July 2014. She was scrapped in Rosneath later that year.