Definition of a child soldier:

A child associated with an armed force or armed group refers to any person below 18 years of age who is, or who has been, recruited or used by an armed force or armed group in any capacity, including but not limited to children, boys and girls, used as fighters, cooks, porters, spies or for sexual purposes.
(Source: Paris Principles on the Involvement of Children in Armed Conflict 2007)