There are nearly 100,000 elementary, middle, and high schools in the US. The best districts are coveted, and a high-caliber school system can be a key factor when a family decides to relocate to one city over another.

Niche, a company that researches and compiles information on schools, provides a ranking of the best school districts in America — that is, the collective quality of all the schools in a district determined by a grade of overall experience.

The ranking includes key factors such as the strength of academics, health and safety, diversity, and the quality of teachers.

Business Insider searched the ranking to find the best in each state. Sufficient data wasn't available for Hawaii, so it does not appear on this list.

CALIFORNIA: Palo Alto Unified School District
No. of schools: 19
No. of students: 12,527
Academics: A+
Health & safety: C+
Diversity: A-
Teachers: A+

ILLINOIS: New Trier Township High School District No. 203
No. of schools: 2
No. of students: 4,099
Academics: A+
Health & safety: A+
Diversity: C
Teachers: A+

MASSACHUSETTS: Wellesley Public Schools
No. of schools: 9
No. of students: 5,067
Academics: A+
Health & safety: A+
Diversity: B-
Teachers: A+

NEW YORK: Jericho Union Free School District
No. of schools: 5
No. of students: 2,960
Academics: A+
Health & safety: A-
Diversity: B
Teachers: A+

WASHINGTON: Bellevue School District
No. of schools: 31
No. of students: 19,456
Academics: A+
Health & safety: B
Diversity: A
Teachers: A

Read the full list of all the best school districts in the United States at Business Insider.