Representing the base-10 structure of numbers is a challenging cognitively ability, unique to humans, but it is yet unknown how precisely this is done. Here, we examined whether and how literate adults represent a number’s full syntactic structure. In 5 experiments, the participants repeated sequences of 6-7 number words, and we systematically varied the order of words within the sequence. Repetition was more accurate when the sequence was grammatical (e.g., ninety-seven) than when it was not (seven-ninety). The performance monotonously improved for sequences with increasingly longer grammatical segments, up to a limit of ~4 words per segment, irrespectively of the number of digits, and worsened thereafter. We conclude that at least for numbers up to 6 digits long, participants represented the number’s full syntactic structure and used it to merge number words into chunks in short-term memory. Short chunks improved memorization, but oversized chunks disrupted memorization. The existence of a chunk size limit suggests that the chunks are not memorized templates, whose size limit is not expected to be so low. Rather, they are created ad-hoc by a generative process, such as the hierarchical syntactic representation hypothesized in Michael McCloskey’s number-processing model. Chunking occurred even when it disrupted performance, and even when external cues for chunking were controlled for or were removed; we conclude that the above generative process operates automatically rather than voluntarily.