Background Percutaneous coronary intervention (PCI) is most commonly guided by angiography alone. Intravascular ultrasound (IVUS) guidance has been shown to reduce major adverse cardiovascular events (MACE) after PCI, principally by resulting in a larger postprocedure lumen than with angiographic guidance. Optical coherence tomography (OCT) provides higher resolution imaging than does IVUS, although findings from some studies suggest that it might lead to smaller luminal diameters after stent implantation. We sought to establish whether or not a novel OCT-based stent sizing strategy would result in a minimum stent area similar to or better than that achieved with IVUS guidance and better than that achieved with angiography guidance alone. Methods In this randomised controlled trial, we recruited patients aged 18 years or older undergoing PCI from 29 hospitals in eight countries. Eligible patients had one or more target lesions located in a native coronary artery with a visually estimated reference vessel diameter of 2·25–3·50 mm and a length of less than 40 mm. We excluded patients with left main or ostial right coronary artery stenoses, bypass graft stenoses, chronic total occlusions, planned two-stent bifurcations, and in-stent restenosis. Participants were randomly assigned (1:1:1; with use of an interactive web-based system in block sizes of three, stratified by site) to OCT guidance, IVUS guidance, or angiography-guided stent implantation. We did OCT-guided PCI using a specific protocol to establish stent length, diameter, and expansion according to reference segment external elastic lamina measurements. All patients underwent final OCT imaging (operators in the IVUS and angiography groups were masked to the OCT images). The primary efficacy endpoint was post-PCI minimum stent area, measured by OCT at a masked independent core laboratory at completion of enrolment, in all randomly allocated participants who had primary outcome data. The primary safety endpoint was procedural MACE. We tested non-inferiority of OCT guidance to IVUS guidance (with a non-inferiority margin of 1·0 mm2), superiority of OCT guidance to angiography guidance, and superiority of OCT guidance to IVUS guidance, in a hierarchical manner. This trial is registered with ClinicalTrials.gov, number NCT02471586. Findings Between May 13, 2015, and April 5, 2016, we randomly allocated 450 patients (158 [35%] to OCT, 146 [32%] to IVUS, and 146 [32%] to angiography), with 415 final OCT acquisitions analysed for the primary endpoint (140 [34%] in the OCT group, 135 [33%] in the IVUS group, and 140 [34%] in the angiography group). The final median minimum stent area was 5·79 mm2 (IQR 4·54–7·34) with OCT guidance, 5·89 mm2 (4·67–7·80) with IVUS guidance, and 5·49 mm2 (4·39–6·59) with angiography guidance. OCT guidance was non-inferior to IVUS guidance (one-sided 97·5% lower CI −0·70 mm2; p=0·001), but not superior (p=0·42). OCT guidance was also not superior to angiography guidance (p=0·12). We noted procedural MACE in four (3%) of 158 patients in the OCT group, one (1%) of 146 in the IVUS group, and one (1%) of 146 in the angiography group (OCT vs IVUS p=0·37; OCT vs angiography p=0·37). Interpretation OCT-guided PCI using a specific reference segment external elastic lamina-based stent optimisation strategy was safe and resulted in similar minimum stent area to that of IVUS-guided PCI. These data warrant a large-scale randomised trial to establish whether or not OCT guidance results in superior clinical outcomes to angiography guidance. Funding St Jude Medical.