8 years of primary school +4 years of secondary school = 12 years.
6 years in primary school+2 years in junior high school+4 years in senior high school = 12 years.
5 years primary school +3 years junior high school +4 years senior high school = 12 years.
So both modes are 12 years. In addition, if American children are under 16 years old but don't go to school, both children and parents will be arrested, so it is not only compulsory education, but also compulsory education.