Postpartum weight retention (PWR) is a risk factor for future obesity. The role of breastfeeding in reducing PWR is not fully understood. We examined the relationship between PWR and the duration of exclusive/partial breastfeeding in 52,367 postpartum women from 2012– 2016 Taiwan national breastfeeding surveys. The women were interviewed at 7–14 months postpartum. Non-linear models were fit to examine the association between PWR and breastfeeding duration. PWR adjusted means and 95% confidence intervals were plotted and compared for the duration of exclusive/partial breastfeeding in the total sample and between pre-pregnancy body-mass index (BMI) groups (underweight, normal, overweight, and obese). Women who breastfed exclusively for >30 days showed significantly lower PWR than those who did not breastfeed and those who breastfed partially for the same duration, thereafter each additional duration of 30 days being associated with an average of 0.1–0.2 kg less PWR. Women who breastfed partially for 120 days showed lower PWR than those who did not or those who ceased to breastfeed, thereafter each additional duration of 30 days being associated with an average of 0.1 kg less PWR. Duration of breastfeeding needed to achieve significantly less PWR differed between pre-pregnancy BMI groups, but the effect of exclusive breastfeeding appeared earlier in the normal weight group. Women with obesity who breastfed exclusively for >30 or partially for >180 days, had lower PWR than non-obese groups. The observed dose–response relationship between breastfeeding duration and PWR supports the “every feeding matters” approach in breastfeeding promotion. The larger effect of exclusive and partial breastfeeding on PWR in women with obesity may draw special attention of breastfeeding promotion.