Primary education (also called elementary education) refers to the first seven to nine years of formal education in most jurisdictions, often in elementary schools, including middle schools. Preschool programs, which are less formal and usually not mandated by law, are generally not considered part of primary education.