Data on the safety of Janus kinase inhibitors (JAKis) in patients with renal impairment are lacking. This study aimed to investigate the safety of JAKis compared to biological (b) DMARDs in patients with rheumatoid arthritis (RA) and renal impairment. We used a multi-centre observational registry of patients with RA in Japan (the ANSWER cohort). We assessed the drug retention rates of b/targeted synthetic DMARDs with different modes of action (tumour necrosis factor inhibitors (TNFis), immunoglobulins fused with cytotoxic T-lymphocyte antigen (CTLA-4-Ig), interleukin-6 receptor inhibitors (IL-6Ris), and JAKis) in patients with RA stratified by pre-treatment estimated glomerular filtration rate (eGFR) levels. The time to discontinuation of bDMARDs or JAKis was analysed using a multivariate Cox proportional hazards model This study included 3775 patients, who were classified into three groups (the normal group (eGFR ≥ 60 mL/min/1.73 m2): 2893 patients; CKDa group (eGFR 45–60 mL/min/1.73 m2): 551; and CKDb group (eGFR < 45 mL/min/1.73 m2): 331). In the CKDb group, the 12-month drug retention rate due to adverse events (AE) was the lowest in patients treated with JAKi (TNFi: 93.1%; IL-6Ri: 94.1%; CTLA-4-Ig: 92.3%; JAKi: 75.1%). In the normal and CKDa groups, drug retention rates due to AE were similar among patients treated with bDMARDs and JAKi. In contrast, drug retention rates due to inefficacy were similar between bDMARDs and JAKis in all groups. In the Cox-proportional model, in the CKDb group, TNFi, IL-6Ri, and CTLA-4-Ig showed lower incidence of drug discontinuation due to AE than JAKis (TNFi: hazard ratio = 0.23 (95% confidence interval 0.09–0.61), IL-6Ri: 0.34 (0.14–0.81), CTLA-4-Ig: 0.36 (0.15–0.89)). JAKis showed the lowest drug retention due to AE in patients with moderate-to-severe and severe renal impairment (eGFR < 45 mL/min/1.73 m2). Physicians should pay more attention to renal function when using JAKis than when using bDMARDs.