Abstract Background Breastfeeding is considered beneficial for both mother and child. In Germany, national guidelines recommend fully breastfeeding for at least 4 months, a goal reached by only 34% of mothers in 2012. The WHO’s recommendation of exclusively breastfeeding for six months was met by 19% only. Hardly modifiable factors such as socio-economic status and migration background have been associated with duration of breastfeeding but little is known about the impact of psychosocial factors such as personality traits and social support. We hypothesise that there are differences in the psychosocial profiles of mothers regarding the duration of breastfeeding. Methods We analyse baseline and follow-up data of the Bielefeld BaBi birth cohort (2013-16). They include detailed migration and socio-economic backgrounds, as well as three measures of psychological characteristics: the optimism scale, the Big Five inventory and the locus of control scales. We perform bivariate and multivariate analyses in order to identify psychosocial determinants of fully breastfeeding for four and six months. Results Out of 780 BaBi study participants, 548 fully breastfed for four months (70.3%), of which 279 continued until at least six months (35.8%). Logistic regression analyses show that fully breastfeeding for at least four or six months is independently associated with the intention to breastfeed and the attendance of antenatal class during this or previous pregnancies. Personality characteristics, social status and migration background show however no significant association with breastfeeding duration. Conclusions Our study results support the promotion of individuals’ breastfeeding intention and attendance to antenatal classes to increase breastfeeding duration. Since differences in breastfeeding practices have the potential to create inequalities in maternal and child health, more efforts are needed to intensify research on modifiable factors influencing breastfeeding duration. Key messages Neither psychosocial factors nor socioeconomic status were associated with breastfeeding duration. Two modifiable factors, breastfeeding intention and attending antenatal classes, were the main predictors of breastfeeding duration.