Of the 58,809 TKA patients, the median 90-day Medicare costs was $23,800 (interquartile range, $18,900-$32,300), while the median of the 27,293 THA patients was $24,000 (interquartile range, $18,500-$33,900). Independent risk factors (all P < .05) resulting in at least a 10% increase in episode-of-care costs following TKA included malnutrition, age over 85, male gender, pulmonary disorder, failed internal fixation, Northeast region, lower socioeconomic status, neurologic disorder, and rheumatoid arthritis. Independent risk factors (all P < .05) resulting in at least a 10% increase in episode-of-care costs following THA included malnutrition, male gender, age over 85, failed internal fixation, hip dysplasia, Northeast region, neurologic disorder, lower socioeconomic status, conversion THA, avascular necrosis, and depression.