IMPORTANCE: Cognitive behavioral therapy (CBT) for obsessive-compulsive disorder (OCD) is a highly specialized treatment that is in short supply worldwide. OBJECTIVES: To investigate whether both therapist-guided and unguided internet-based CBT (ICBT) are noninferior to face-to-face CBT for adults with OCD, to conduct a health economic evaluation, and to determine whether treatment effects were moderated by source of participant referral. DESIGN, SETTING, AND PARTICIPANTS: This study is a single-blinded, noninferiority, randomized clinical trial, with a full health economic evaluation, conducted between September 2015 and January 2020, comparing therapist-guided ICBT, unguided ICBT, and individual face-to-face CBT for adults with OCD. Follow-up data were collected up to 12 months after treatment. The study was conducted at 2 specialist outpatient OCD clinics in Stockholm, Sweden. Participants included a consecutive sample of adults with a primary diagnosis of OCD, either self-referred or referred by a clinician. Data analysis was performed from June 2019 to January 2022. INTERVENTIONS: Guided ICBT, unguided ICBT, and face-to-face CBT delivered over 14 weeks. MAIN OUTCOMES AND MEASURES: The primary end point was the change in OCD symptom severity from baseline to 3-month follow-up. The noninferiority margin was 3 points on the masked assessor-rated Yale-Brown Obsessive Compulsive Scale. RESULTS: A total of 120 participants were enrolled (80 women [67%]; mean [SD] age, 32.24 [9.64] years); 38 were randomized to the face-to-face CBT group, 42 were randomized to the guided ICBT group, and 40 were randomized to the unguided ICBT group. The mean difference between therapist-guided ICBT and face-to-face CBT at the primary end point was 2.10 points on the Yale-Brown Obsessive Compulsive Scale (90% CI, -0.41 to 4.61 points; P = .17), favoring face-to-face CBT, meaning that the primary noninferiority results were inconclusive. The difference between unguided ICBT and face-to-face CBT was 5.35 points (90% CI, 2.76 to 7.94 points; P < .001), favoring face-to-face CBT. The health economic analysis showed that both guided and unguided ICBT were cost-effective compared with face-to-face CBT. Source of referral did not moderate treatment outcome. The most common adverse events were anxiety (30 participants [25%]), depressive symptoms (20 participants [17%]), and stress (11 participants [9%]). CONCLUSIONS AND RELEVANCE: The findings of this randomized clinical trial of ICBT vs face-to-face CBT for adults with OCD do not conclusively demonstrate noninferiority. Therapist-guided ICBT could be a cost-effective alternative to in-clinic CBT for adults with OCD in scenarios where traditional CBT is not readily available; unguided ICBT is probably less efficacious but could be an alternative when providing remote clinician support is not feasible.