BackgroundWith notable benefits in reducing length of stay (LOS), this study aimed to quantify the temporal trend and the factors contributing to increased LOS for primary and revision total hip (THA and rTHA) and knee (TKA and rTKA) arthroplasty. The study was carried out for a large population-based cohort over a 20-year period. MethodsThis was a retrospective population-based study assessing the LOS for all primary and revision THA and TKA procedures between 2003 and 2022. The primary outcome of interest was LOS. Univariate and multivariate analyses were performed to identify associated variables. ResultsFor the entire dataset, there were 16,677 primary THAs, 13,018 primary TKAs, 3276 (aseptic) rTHAs, 1445 (aseptic) rTKAs, 820 (septic) rTHAs, and 667 (septic) rTKAs. The median LOS over the 20-year period between 2003 and 2022 demonstrated a steady and continuous decline from a median of 5 days (interquartile range 3-7) in 2003 to 1 day (interquartile range 1-2) in 2022. On multivariate analysis, there were a number of factors associated with increasing LOS: year of procedure (P < .0001), procedure type (P < .0001), age (P < .0001), and American Society of Anesthesiologists class (P < .0001). On multivariate analysis, body mass index was not associated with increased LOS (P = .5631). ConclusionsThere was a downward trend in LOS for all types of primary and revision THA and TKA. The factors contributing most to a reduction in LOS include the year the procedure was performed, primary THA procedures, aseptic (vs periprosthetic joint infection) revision procedures, younger age, and lower American Society of Anesthesiologists classes.