OBJECTIVES: Adverse lifestyle promotes escalating excess gestational weight gain (GWG) driving poor maternal and neonatal health outcomes. Recommended pregnancy lifestyle interventions rely on accurate assessment and prediction of GWG. A modelling technique to accommodate the complexities of GWG data and allow for the inclusion of maternal factors that influence the variation in GWG trajectory across pregnancy is necessary. We aimed to explore and determine the optimal statistical methods to accommodate data complexities such as nonlinearity, skewness and kurtosis and to model GWG trajectories from a large dataset of ethnically diverse pregnant women. DESIGN AND SETTING: This is a retrospective, observational study of routinely collected health data from women with singleton pregnancies from 2017 to 2021 delivering at one of the largest hospital networks in Australia, located in southeast Melbourne. PARTICIPANTS: There were 39 846 women with singleton pregnancies. Women had measurements taken during routine care at several time points throughout the pregnancy. Participants were from a diverse ethnic population, with the majority born overseas from 136 different countries (grouped into 12 world regions). OUTCOME: GWG was defined as the weight measured minus pre-pregnancy weight. Multiple statistical approaches were applied to model GWG trajectories: linear regression, cubic polynomial, neural network, generalised linear models and general additive model for location, scale and shape (GAMLSS) Box-Cox suite of models (including fitting fractional polynomials, cubic splines and penalised B-splines). RESULTS: The dataset included 39 846 women and 109 339 GWG measurements. The two best-fitting models were derived using the GAMLSS Box-Cox t distribution: one with penalised B-splines and the other with cubic splines. Both models yielded the lowest Akaike information criterion and a generalised R-squared of 0.70. However, residual analysis indicated a preference for the model with penalised B-splines, making it the optimal choice. Using this optimal model, we demonstrate how to generate centile charts for the sample population. CONCLUSION: The optimal model developed will underpin our new epidemiological tool for the assessment and prediction of GWG. Using the model, individualised centile charts are relatively easy to produce, making them accessible to both healthcare providers and pregnant individuals. The visual nature of centile graphs makes it easier to see whether a woman's GWG is on track, which is helpful for making informed decisions about nutrition, lifestyle and healthcare.