LIMESTONE, Maine — Maine schools took four of the top 1,000 spots nationwide in a new ranking of the best public high schools in the country, according to Niche, a Pittsburgh-based provider of information on neighborhoods, colleges and K-12 schools.

Niche also ranks the schools locally by state, county and major city or town, and grades them through various subcategories like teachers, STEM and athletics.

The website details its methodology, which includes the factors considered and respective weights. Among them, "academics grade" is 60%, while "culture and diversity grade," "parent/student surveys on overall experience" and "teachers grade" make up 10% each, followed by four factors of 2.5% weight.

RELATED: Small Maine high school ranked 2nd best in the country
RELATED: MSSM ranked No. 2 U.S. News Best High School

No. 1: Maine School of Science & Mathematics (Limestone)

Maine-School-of-Science-and-Mathematics
Maine School of Science & Mathematics
NEWS CENTER Maine

Overall Grade: A+
Students: 145
Student-Teacher Ratio: 8:1

Proficiency: 90% Reading, 90% Math
Graduation Rate: 90%

MSSM-grades
Niche

No. 1 in Maine
No. 1 for Teachers in Maine
No. 1 for College Prep in Maine
No. 1 for STEM in Maine

No. 7 for Teachers in Nation
No. 29 Magnet in Nation
No. 59 for STEM in Nation
No. 82 in Nation
No. 157 College Prep in Nation

No. 2: Cape Elizabeth High School (Cape Elizabeth)

Cape-Elizabeth-High-School
Cape Elizabeth High School
NEWS CENTER Maine

Overall Grade: A+
Students: 515
Student-Teacher Ratio: 12:1

Proficiency: 87% Reading, 72% Math
Graduation Rate: 95%

CEHS-grades
Niche

No. 2 in Maine
No. 2 for Athletes in Maine
No. 2 for College Prep in Maine
No. 2 for STEM in Maine
No. 4 for Teachers in Maine

No. 161 for Athletes in Nation
No. 314 for Teachers in Nation
No. 468 in Nation
No. 480 for STEM in Nation
No. 620 for College Prep in Nation

No. 3: Yarmouth High School (Yarmouth)

Yarmouth-High-School
Yarmouth High School
NEWS CENTER Maine

Overall Grade: A+
Students: 502
Student-Teacher Ratio: 12:1

Proficiency: 87% Reading, 72% Math
Graduation Rate: 95%

YHS-grades
Niche

No. 3 in Maine
No. 3 for Teachers in Maine
No. 3 for College Prep in Maine
No. 6 for STEM in Maine
No. 13 for Athletes in Maine

No. 290 for Teachers in Nation
No. 541 in Nation
No. 713 for STEM in Nation
No. 846 for College Prep in Nation

No. 4: Falmouth High School (Falmouth)

Falmouth-High-School
Falmouth High School
NEWS CENTER Maine

Overall Grade: A+
Students: 704
Student-Teacher Ratio: 11:1

Proficiency: 92% Reading, 77% Math
Graduation Rate: 95%

FHS-grades
Niche

No. 4 in Maine
No. 4 for College Prep in Maine
No. 5 for STEM in Maine
No. 7 for Teachers in Maine
No. 17 for Athletes in Maine

No. 672 for STEM in Nation
No. 736 in Nation

No. 5: Scarborough High School (Scarborough)

Scarborough-High-School
Scarborough High School
NEWS CENTER Maine

Overall Grade: A
Students: 996
Student-Teacher Ratio: 12:1

Proficiency: 77% Reading, 59% Math
Graduation Rate: 95%

SHS-grades
Niche

No. 1 for Athletes in Maine
No. 5 in Maine
No. 5 for Teachers in Maine
No. 7 for College Prep in Maine
No. 13 for STEM in Maine

No. 98 for Athletes in Nation
No. 417 for Teachers in Nation

No. 6: Greely High School (Cumberland)

Greely-High-School
Greely High School
NEWS CENTER Maine

Overall Grade: A
Students: 632
Student-Teacher Ratio: 10:1

Proficiency: 82% Reading, 67% Math
Graduation Rate: 95%

GHS-grades
Niche

No. 5 for College Prep in Maine
No. 6 in Maine
No. 8 for STEM in Maine
No. 24 for Athletes in Maine
No. 24 for Teachers in Maine

No. 7: Camden Hills Regional High School (Rockport)

Camden-Hills-Regional-High-School
Camden Hills Regional High School
NEWS CENTER Maine

Overall Grade: A
Students: 695
Student-Teacher Ratio: 12:1

Proficiency: 82% Reading, 57% Math
Graduation Rate: 92%

CHRHS-grades
Niche

No. 7 in Maine
No. 8 for Teachers in Maine
No. 8 for College Prep in Maine
No. 9 for STEM in Maine
No. 86 for Athletes in Maine

No. 8: Brunswick High School (Brunswick)

Brunswick-High-School
Brunswick High School
NEWS CENTER Maine

Overall Grade: A
Students: 735
Student-Teacher Ratio: 10:1

Proficiency: 82% Reading, 52% Math
Graduation Rate: 92%

BHS-grades
Niche

No. 8 in Maine
No. 9 for College Prep in Maine
No. 20 for STEM in Maine
No. 21 for Athletes in Maine
No. 37 for Teachers in Maine

No. 9: Casco Bay High School (Portland)

Casco-Bay-High-School
Casco Bay High School
NEWS CENTER Maine

Overall Grade: A-
Students: 378
Student-Teacher Ratio: 14:1

Proficiency: 67% Reading, 32% Math
Graduation Rate: 92%

CBHS-grades
Niche

No. 4 for Diversity in Maine
No. 6 for College Prep in Maine
No. 9 in Maine
No. 16 for Teachers in Maine
No. 36 for STEM in Maine

No. 101 for Arts in Nation

No. 10: Orono High School (Orono)

Orono-High-School
Orono High School
NEWS CENTER Maine

Overall Grade: A-
Students: 347
Student-Teacher Ratio: 11:1

Proficiency: 67% Reading, 52% Math
Graduation Rate: 92%

OHS-grades
Niche

No. 7 for Athletes in Maine
No. 10 in Maine
No. 12 for College Prep in Maine
No. 17 for STEM in Maine
No. 46 for Teachers in Maine

MORE OVERALL STATE RANKINGS

No. 11: Baxter Academy for Tech & Sciences (Portland)
No. 12: Mt. Desert Island High School (Bar Harbor)
No. 13: Kennebunk High School (Kennebunk)
No. 14: Wells High School (Wells)
No. 15: Islesboro Central School (Islesboro)

No. 16: Bangor High School (Bangor)
No. 17: Portland High School (Portland)
No. 18: York High School (York)
No. 19: Gorham High School (Gorham)
No. 20: Marshwood High School (South Berwick)

No. 21: Greenville Consolidated School (Greenville)
No. 22: Deering High School (Portland)
No. 23: Hampden Academy (Hampden)
No. 24: Freeport High School (Freeport)
No. 25: South Portland High School (South Portland)

No. 26: Winthrop High School (Winthrop)
No. 27: Boothbay Regional High School (Boothbay Harbor)
No. 28: Deer Isle-Stonington High School (Deer Isle)
No. 29: Monmouth Academy (Monmouth)
No. 30: Morse High School (Bath)

No. 31: Maranacook Community High School (Readfield)
No. 32: Rangeley Lakes Regional School (Rangeley)
No. 33: Robert W. Traip Academy (Kittery)
No. 34: Waterville Senior High School (Waterville)
No. 35: Hall-Dale High School (Farmingdale)

No. 36: Presque Isle High School (Presque Isle)
No. 37: Ellsworth High School (Ellsworth)
No. 38: Mt. Ararat High School (Topsham)
No. 39: Easton Junior/Senior High School (Easton)

No. 40: Oceanside High School East (Rockland)
No. 41: Hermon High School (Hermon)
No. 42: Lawrence High School (Fairfield)
No. 43: Buckfield Junior/Senior High School (Buckfield)
No. 44: Old Town High School (Old Town)
No. 45: Windham High School (Windham)

No. 46: Wiscasset Middle/High School (Wiscasset)
No. 47: Leavitt Area High School (Turner)
No. 48: Gray-New Gloucester High School (Gray)
No. 49: Mt. Blue High School (Farmington)
No. 50: Winslow High School (Winslow)

Find Maine's full rankings here.