The extent to which lifestyle factors such as tobacco consumption and obesity affect the outcome after inguinal hernia surgery has been poorly studied. This study was undertaken to assess the effect of smoking, smokeless tobacco consumption and obesity on postoperative complications after inguinal hernia surgery. The second aim was to evaluate the effect of tobacco consumption and obesity on the length of hospital stay. A cohort of 12,697 Swedish construction workers with prospectively collected exposure data on tobacco consumption and body mass index (BMI) from 1968 onward were linked to the Swedish inpatient register. Information on inguinal hernia procedures was collected from the inpatient register. Any postoperative complication occurring within 30 days was registered. In addition to this, the length of hospitalization was calculated. The risk of postoperative complications due to tobacco exposure and BMI was estimated using a multiple logistic regression model and the length of hospital stay was estimated in a multiple linear regression model. After adjusting for the other covariates in the multivariate analysis, current smokers had a 34% (OR 1.34, 95% CI 1.04, 1.72) increased risk of postoperative complications compared to never smokers. Use of "Swedish oral moist snuff" (snus) and pack-years of tobacco smoking were not found to be significantly associated with an increased risk of postoperative complications. BMI was found to be significantly associated with an increased risk of postoperative complications (P = 0.04). This effect was mediated by the underweighted group (OR 2.94; 95% CI 1.15, 7.51). In a multivariable model, increased BMI was also found to be significantly associated with an increased mean length of hospital stay (P < 0.001). There was no statistically significant association between smoking or using snus, and the mean length of hospitalization after adjusting for the other covariates in the model. Smoking increases the risk of postoperative complications even in minor surgery such as inguinal hernia procedures. Obesity increases hospitalization after inguinal hernia surgery. The Swedish version of oral moist tobacco, snus, does not seem to affect the complication rate after hernia surgery at all.