I'm an emergency physician, and I also write the code behind Growo, a set of child growth calculators in 17 languages and an MCP server that AI assistants can call. Parents kept asking me what the percentile on their child's chart meant. Answering properly meant computing it the way the WHO and the CDC do, then finding every place where a correct formula still gives the wrong number.
This post covers the formula, about 20 lines of TypeScript, and seven edge cases we hit. Every number below was recomputed with the production engine while writing.
The LMS method in one formula
The WHO and CDC growth charts are built with the LMS method (Cole and Green). For every age they publish three parameters:
M : the median
S : the coefficient of variation, which sets the spread
L : a Box-Cox power that removes the skew.…