The potential impact of birthweight on adult lung function has been postulated, yet the precise nature of this association in later life remains inconclusive. This study involved extracting data from a total of 201,615 individuals from the UK Biobank dataset. To identify group differences in lung function based on birthweight subgroups, propensity score matching and a pairwise t-test were conducted. The impact of birthweight on lung function was established using a linear regression, gradually adjusting for variables. Additionally, subgroup analyses were conducted to investigate whether the relationship between birthweight and lung function was modified by variations in age-related lung function changes. The modifying effect was examined by adding a multiplicative interaction term. The low birthweight group demonstrated significantly lower forced expiratory volume in 1 second (FEV1) and forced vital capacity (FVC) in comparison to those in the adequate birthweight group (P < 0.001). Conversely, no statistically significant distinction was observed in macrosomia (P = 0.374 for FEV1; P = 0.911 for FVC). A positive linear correlation between birthweight and lung function was observed within each interval, specifically in the subgroup of individuals with a birthweight ranging from 2.5 to 4 Kg. After accounting for various confounding factors, every 1 Kg increase in birthweight was found to be significantly associated with a mean increase in FEV1 of 70.9 mL (95% CI 63.7 to 78.1, P < 0.001) in males and 56.0 mL (95% CI 52.1 to 59.9, P < 0.001) in females. Additionally, there was a significant increase in FVC of 86.7 mL (95% CI 78.3 to 95.1, P < 0.001) in males and 62.2 mL (95% CI 57.5 to 66.9, P < 0.001) in females. Additionally, macrosomia group demonstrated a more pronounced decrease in lung function over time, in contrast to the low birthweight group which exhibited a similar decline pattern to the adequate birthweight group. The utilization of a rigorous statistical methodology has enabled us to derive reliable results, indicating that attaining an optimal birthweight is of utmost importance in determining respiratory health.