As tenofovir disoproxil fumarate (TDF) requires long-term use, a reduction in bone density should be considered a possibility when treating patients with chronic hepatitis B (CHB) with aging and systemic diseases. Patients treated with tenofovir alafenamide (TAF) have improved bone mineral density loss compared to patients treated with TDF. Although improvements in bone density caused by TAF have been reported, studies on the actual reduction of fractures are insufficient. To evaluate the impact of TAF on the risk of osteoporotic fractures in comparison with that of TDF. Using the national claims data of the Health Insurance Review and Assessment Service, we conducted a retrospective cohort study of 32,582 patients with CHB who had been initially treated with TDF or TAF between November 2017 and December 2020. The numbers of patients treated with TDF and TAF were 20,877 and 11,705, respectively. The annual fracture rate per 100 patients in each group was calculated, and the Cox proportional hazard ratio (HR) was analysed after applying inverse probability treatment weights (IPTW) for both groups. Among 32,582 patients, the average age was 47.8 ± 11.2 years, 64.5% were men, and the follow-up period was 24.4 ± 11.6 months. The incidence of osteoporotic fractures was 0.78 and 0.49 per 100 person-years in the TDF and TAF groups, respectively. After application of IPTW, the HR was 0.68 (95% confidence interval 0.55-0.85, p = 0.001). TAF-treated patients with CHB had a significantly lower risk of osteoporotic fracture than TDF-treated patients.