Abstract The long-term impact of eating duration on the risk of all-cause mortality remains unclear, with limited exploration of how different levels of energy intake and physical activity might influence this impact. To investigate, 24 484 American adults from the National Health and Nutrition Examination Survey spanning 1999–2018 were included. Eating duration was assessed via 24-h dietary recall, and all-cause mortality data were sourced from the National Death Index. The relationship between eating duration and all-cause mortality was analysed using Cox proportional hazards regression models, restricted cubic splines and stratification analysis with complex weighted designs. The median (IQR) of eating duration for participants was 12·5 (11·0, 14·0) h. In this study, 2896 death events were observed, and the median follow-up time (IQR) was 125 (77, 177) months. After multivariable adjustment, compared with Q1, Q2, Q3 and Q4 had reduced risks of all-cause mortality by 17, 15 and 13 %, respectively. Furthermore, each additional hour of eating duration was correlated with a 2 % decrease in the risk of all-cause mortality. Additionally, a non-linear dose–response relationship was observed between eating duration and the risk of all-cause mortality, showing a U-shaped relationship from 8·9 h to 15·3 h (P for non-linearity < 0·05). Interestingly, the non-linear dose–response relationship was observed exclusively among individuals with high energy intake or a lightly active physical activity level. These findings suggest potential health benefits from adjusting eating duration, though further prospective studies are needed for validation.