Randomized clinical trials comparing direct oral anticoagulants (DOACs) to warfarin in cancer patients have not been performed. We evaluated the effectiveness and associated risk of DOACs vs warfarin, as well as comparisons of DOACs, in a large population of cancer patients with nonvalvular atrial fibrillation (AF). Using the MarketScan databases, we identified 16 096 AF patients (mean age, 74 years) initiating oral anticoagulant and being actively treated for cancer between 2010 and 2014. Anticoagulant users were matched by age, sex, enrollment date, and drug initiation date. Study end points were identified with diagnostic codes and included ischemic stroke, severe bleeding, other bleeding, and venous thromboembolism (VTE). Cox regression was used to estimate associations of anticoagulants with study end points. Compared with warfarin, rates of bleeding (hazard ratio [95% confidence interval]) were similar in rivaroxaban (1.09 [0.79, 1.39]) and dabigatran (0.96 [0.72, 1.27]) users, whereas apixaban users experienced lower rates (0.37 [0.17, 0.79]). Rates of ischemic stroke did not differ among anticoagulant users. Compared with warfarin, rate of VTE (hazard ratio [95% confidence interval]) was lower among rivaroxaban (0.51 [0.41, 0.63]), dabigatran (0.28 [0.21, 0.38]), and apixaban (0.14 [0.07, 0.32]) users. In head-to-head comparisons among DOACs, dabigatran users had lower rates of VTE than rivaroxaban users; apixaban users had lower rates of VTE and severe bleeding than rivaroxaban users. In this population of patients with AF and cancer, DOAC users experienced lower or similar rates of bleeding and stroke compared with warfarin users, and a lower rate of incident VTE.