We assessed the role of tuberculosis (TB) disease and HIV infection on the level of physical activity. A combined heart rate and movement sensor was used to assess habitual physical activity in TB patients and non-TB controls. The association between sputum-negative TB, sputum-positive TB, HIV and physical activity estimates were assessed in multivariable linear regression models adjusted for age, sex, haemoglobin and alpha-1-acid glycoprotein (AGP). Sputum-positive [eB 0·43, 95% confidence interval (CI) 0·29–0·64] and sputum-negative (eB 0·67, 95% CI 0·47–0·94) TB as well as HIV infection (eB 0·59, 95% CI 0·46–0·75) were associated with reduced activity compared to controls. Anaemia accounted for a substantial part of the effects of HIV, while elevated AGP primarily mediated the TB effect. The level of physical activity is highly influenced by TB and HIV, and mainly mediated through anaemia of infection and associated with elevated acute phase response.