IMPORTANCE Most patients with primary aldosteronism, a major cause of secondary hypertension, are not identified or appropriately treated because of difficulties in diagnosis and subtype classification. Applications of artificial intelligence combined with mass spectrometry-based steroid profiling could address this problem. OBJECTIVE To assess whether plasma steroid profiling combined with machine learning might facilitate diagnosis and treatment stratification of primary aldosteronism, particularly for patients with unilateral adenomas due to pathogenic KCNJ5 sequence variants. DESIGN, SETTING, AND PARTICIPANTS This diagnostic study was conducted at multiple tertiary care referral centers. Steroid profiles were measured from June 2013 to March 2017 in 462 patients tested for primary aldosteronism and 201 patients with hypertension. Data analyses were performed from September 2018 to August 2019. MAIN OUTCOMES AND MEASURES The aldosterone to renin ratio and saline infusion tests were used to diagnose primary aldosteronism. Subtyping was done by adrenal venous sampling and follow-up of patients who underwent adrenalectomy. Statistical tests and machine-learning algorithms were applied to plasma steroid profiles. Areas under receiver operating characteristic curves, sensitivity, specificity, and other diagnostic performance measures were calculated. RESULTS Primary aldosteronism was confirmed in 273 patients (165 men [60%]; mean [SD] age, 51 [10] years), including 134 with bilateral disease and 139 with unilateral adenomas (58 with and 81 without somatic KCNJ5 sequence variants). Plasma steroid profiles varied according to disease subtype and were particularly distinctive in patients with adenomas due to KCNJ5 variants, who showed better rates of biochemical cure after adrenalectomy than other patients. Among patients tested for primary aldosteronism, a selection of 8 steroids in combination with the aldosterone to renin ratio showed improved effectiveness for diagnosis over either strategy alone. In contrast, the steroid profile alone showed superior performance over the aldosterone to renin ratio for identifying unilateral disease, particularly adenomas due to KCNJ5 variants. Among 632 patients included in the analysis, machine learning-designed combinatorial marker profiles of 7 steroids alone both predicted primary aldosteronism in 1 step and subtyped patients with unilateral adenomas due to KCNJ5 variants at diagnostic sensitivities of 69% (95% CI, 68%-71%) and 85% (95% CI, 81%-88%), respectively, and at specificities of 94% (95% CI, 93%-94%) and 97% (95% CI, 97%-98%), respectively. The validation series yielded comparable diagnostic performance. CONCLUSIONS AND RELEVANCE Machine learning-designed combinatorial plasma steroid profiles may facilitate both screening for primary aldosteronism and identification of patients with unilateral (continued) Key Points Question Does steroid profiling combined with machine learning offer a potential 1-step strategy to facilitate diagnosis and subtype classification for t...