Limb salvage surgery (LSS) with megaprosthesis is a common treatment for distal femur tumors, but its impact on gait remains poorly understood. Traditional gait analysis methods are costly and require specialized equipment. This study aims to compare spatiotemporal gait parameters between patients with distal femur megaprosthesis and healthy controls using an inertial measurement unit (IMU). We conducted a case–control study with 79 participants: 31 patients with distal femur megaprosthesis and 48 healthy controls. Gait data were collected using an IMU placed at L5-S1, capturing metrics such as gait quality index (GQI), pelvic kinematics, propulsion index, and gait speed. Statistical analysis included Student’s t-test, Mann–Whitney U test, and one-way ANOVA to compare gait parameters across groups. Patients with megaprosthesis exhibited significantly lower gait speed, propulsion index and anteroposterior acceleration symmetry index compared to controls (p < .05). GQI was reduced in the healthy legs of the cases (92.3%) compared to control legs (96.6%). Adaptations included prolonged stance phases in healthy legs and decreased single support phases in prosthetic legs. Despite these changes, gait patterns remained within functional ranges. IMU-based gait analysis reveals significant but functional alterations in gait mechanics among patients with distal femoral megaprosthesis. These findings underscore the need for tailored rehabilitation strategies to address compensatory mechanisms, optimize mobility, and enhance long-term outcomes. The use of IMU technology offers a cost-effective and portable alternative for clinical gait assessments.