This study assessed the application of metagenomic next-generation sequencing in pathogen detection of periprosthetic joint infections. A total of 95 cases who previously had undergone hip and knee replacement undergoing revision from January 2018 to January 2021 were included in this study. Specimens of synovial fluid and deep-tissue were collected for culture and metagenomic next-generation sequencing, and patients were retrospectively categorized as infected or aseptic using the Musculoskeletal Infection Society criteria after revision surgery. The sensitivity, specificity, positive and negative predictive values were compared. A total of 36 cases had positive culture results and 59 cases had positive metagenomic next-generation sequencing results. Culture was positive in 34 infected cases (58.6%) and 2 aseptic cases (5.4%). Metagenomic next-generation sequencing was positive in 55 infected cases (94.8%) and 4 aseptic cases (10.8%). Five cases diagnosed with infection had other potential pathogens detected by metagenomic next-generation sequencing. Among the 24 culture-negative periprosthetic joint infections, metagenomic next-generation sequencing was able to identify potential pathogens in 21 cases (87.5%). From sampling to reporting, the average time needed for culture was 5.2 (95% CI 3.1–7.3) days, while that for metagenomic next-generation sequencing was 1.3 (95% CI 0.9–1.7) days. Metagenomic next-generation sequencing is more advantageous in pathogen detection of periprosthetic joint infection after total joint replacement, especially in patients with multiple infections or negative culture results.