The best public high school in America is Walter Payton College Prep, according to school-ranking company Niche.

Students at Walter Payton, a high school that's part of Chicago Public Schools, earn high standardized test scores and nearly all of them graduate.

But Illinois isn't the only state with great public schools, so Business Insider used Niche's list to find the best high school in every state.

The ranking analyzed 17,867 public high schools and rated schools in areas like academics, teachers, student culture and diversity, and resources and facilities.

California: Henry M. Gunn High School
Location: Palo Alto, California
Overall rank: #23
Graduation rate: 96%
AP Enrollment: 38%

District of Columbia: The School Without Walls High School
Location: Washington, District of Columbia
Overall rank: #70
Graduation rate: 95%
AP Enrollment: 68%

New York: Stuyvesant High School
Location: New York, New York
Overall rank: #7
Graduation rate: 99%
AP Enrollment: 53%

Ohio: Walnut Hills High School
Location: Cincinnati, Ohio
Overall rank: #51
Graduation rate: 96%
AP Enrollment: 49%

Texas: Liberal Arts & Science Academy
Location: Austin, Texas
Overall rank: #12
Graduation rate: 99%
AP Enrollment: 74%

Read the full list of the best public high school in each state at Business Insider.