Shariah has commanded children to not fast. They are allowed to offer some fasts when they are closer to puberty. One should not make children fast as it is sinful.
At the age of 12 to 13, one should start offering some (one or two) fasts and by 18 years, one should become regular in fasting. It is the responsibility of parents to prevent their young children from fasting. Later when the children grow older, the parents should encourage them.
Some young people are not ready to fast till 21 as per development and their physical strength. Hence there is no set age of 18 for fasting. It varies from individual to individual according to their physical strength.
The Promised Messiah’s (as) daughter remarked that the Promised Messiah (as) did not like children fasting consistently and once made her open her fast because she was very young.