Clostridioides (Clostridium) difficile infection (CDI) is the leading cause of infectious diarrhoea in hospitalised patients, representing a substantial economic burden driven mainly by increased length of hospital stay (LoS). Currently in Japan, limited evidence on CDI-associated excess LoS is available. We conducted a retrospective, matched-cohort study using a large, Japanese, hospital-based administrative database. CDI was defined as CDI treatment plus either CDI diagnosis or positive enzyme immunoassay result. Propensity score matching at the time of CDI or recurrent CDI (rCDI) onset was applied to adjust baseline confounding and immortal time bias. The analysis included 5 994 054 hospitalisation records during 2008–2017, of which 11 823 were identified as CDI and 1359 as rCDI. The median excess LoS attributable to CDI and rCDI was 3 days and 6.5 days, respectively. The excess mortality attributable to CDI was 6.9%; there was no excess mortality attributable to rCDI (−1.9%). The median difference in costs attributable to CDI and rCDI during the residual stay was JPY 130 296 (USD 1185) and JPY 81 054 (USD 737) per hospitalisation, respectively. By adjusting the biases, the burden of CDI in Japan was evaluated. The findings could support decision making and resource allocation for CDI management in Japanese hospitals.