(STACKER) – What makes the best county in each state? Often it involves a good mix of opportunities for fun outdoor activities and cultural attractions. Throw in some historical sites, good schools, job opportunities, and affordable housing, and the county will most likely have happy residents.

Stacker compiled a list of the best places to live using 2022 data from Niche, which ranks counties based on various factors, including public schools, jobs, and living costs. Read more about Niche and the way it determines the best counties in each state by looking at its methodology.

The counties on this list include an Alaskan borough whose bay remains open year-round, which keeps its economy humming. There’s Huntsville, Alabama, which was nicknamed “Rocket City” for the work people in town did to get spaceships to the moon. Others, such as Fairfield County, Connecticut, have drawn on financial services to fund their tax bases. One of the wealthiest of counties is in California, its fate tied up with Silicon Valley.

Some are on the coasts, but others are inland, away from crowds and tourist destinations. Many of the counties on this list have extensive parks, often honoring distinctive geographical features that offer exercise and exploration opportunities. Residents can also keep their minds sharp with museums, art galleries, theater, and other cultural pursuits.

Some of the counties include universities that provide lectures, concerts, and other intellectual outlets for residents. Others have great shopping opportunities, restaurants, wine bars, and pubs for evenings out without navigating the traffic of a larger city. Some suburban counties became more popular than ever after the coronavirus pandemic hit and families left crowded cities for more open spaces. 

They also rely on a range of businesses, from high-tech firms and hedge funds that have set up shop outside of urban centers to wineries and generations-old farms now providing organic fruits, vegetables, and other crops.

Alabama: Madison County

– Population: 382,149
– Median home value: $202,500 (67% own)
– Median rent: $936 (33% rent)
– Median household income: $71,153

Alaska: Valdez-Cordova Borough

– Population: 9,243
– Median home value: $222,200 (75% own)
– Median rent: $1,067 (25% rent)
– Median household income: $79,867

Arizona: Maricopa County

– Population: 4,367,186
– Median home value: $304,700 (64% own)
– Median rent: $1,275 (36% rent)
– Median household income: $72,944

Arkansas: Benton County

– Population: 278,774
– Median home value: $211,100 (67% own)
– Median rent: $1,002 (33% rent)
– Median household income: $76,887

California: San Mateo County

– Population: 762,488
– Median home value: $1,225,900 (60% own)
– Median rent: $2,599 (40% rent)
– Median household income: $136,837

Colorado: Boulder County

– Population: 328,713
– Median home value: $575,700 (63% own)
– Median rent: $1,694 (37% rent)
– Median household income: $92,466

Connecticut: Fairfield County

– Population: 956,446
– Median home value: $443,100 (67% own)
– Median rent: $1,593 (33% rent)
– Median household income: $101,194

Delaware: New Castle County

– Population: 567,769
– Median home value: $275,600 (68% own)
– Median rent: $1,228 (32% rent)
– Median household income: $78,428

Florida: St. Johns County

– Population: 265,724
– Median home value: $348,100 (82% own)
– Median rent: $1,462 (18% rent)
– Median household income: $88,794

Georgia: Oconee County

– Population: 41,006
– Median home value: $329,700 (84% own)
– Median rent: $1,203 (16% rent)
– Median household income: $106,165

Hawaii: Honolulu County

– Population: 1,015,167
– Median home value: $726,800 (58% own)
– Median rent: $1,870 (42% rent)
– Median household income: $92,600

Idaho: Ada County

– Population: 485,246
– Median home value: $342,500 (71% own)
– Median rent: $1,163 (29% rent)
– Median household income: $75,115

Illinois: DuPage County

– Population: 934,094
– Median home value: $324,900 (73% own)
– Median rent: $1,433 (27% rent)
– Median household income: $100,292

Indiana: Hamilton County

– Population: 341,616
– Median home value: $302,400 (77% own)
– Median rent: $1,265 (23% rent)
– Median household income: $104,858

Iowa: Dallas County

– Population: 96,604
– Median home value: $273,800 (71% own)
– Median rent: $1,078 (29% rent)
– Median household income: $93,492

Kansas: Johnson County

– Population: 605,154
– Median home value: $294,300 (69% own)
– Median rent: $1,201 (31% rent)
– Median household income: $96,059

Kentucky: Oldham County

– Population: 67,586
– Median home value: $314,300 (87% own)
– Median rent: $1,032 (13% rent)
– Median household income: $109,815

Louisiana: Ascension Parish

– Population: 125,289
– Median home value: $228,000 (82% own)
– Median rent: $1,087 (18% rent)
– Median household income: $86,256

Maine: Cumberland County

– Population: 300,776
– Median home value: $314,700 (71% own)
– Median rent: $1,273 (29% rent)
– Median household income: $80,679

Maryland: Howard County

– Population: 329,248
– Median home value: $483,200 (73% own)
– Median rent: $1,790 (27% rent)
– Median household income: $129,549

Massachusetts: Middlesex County

– Population: 1,623,411
– Median home value: $575,500 (62% own)
– Median rent: $1,815 (38% rent)
– Median household income: $111,790

Michigan: Washtenaw County

– Population: 372,428
– Median home value: $293,800 (61% own)
– Median rent: $1,218 (39% rent)
– Median household income: $79,198

Minnesota: Hennepin County

– Population: 1,270,283
– Median home value: $309,200 (63% own)
– Median rent: $1,244 (37% rent)
– Median household income: $85,438

Mississippi: Madison County

– Population: 108,248
– Median home value: $236,000 (72% own)
– Median rent: $948 (28% rent)
– Median household income: $74,688

Missouri: St. Louis County

– Population: 1,001,982
– Median home value: $220,100 (69% own)
– Median rent: $1,032 (31% rent)
– Median household income: $72,562

Montana: Gallatin County

– Population: 116,725
– Median home value: $435,400 (62% own)
– Median rent: $1,212 (38% rent)
– Median household income: $76,208

Nebraska: Lancaster County

– Population: 320,301
– Median home value: $204,400 (60% own)
– Median rent: $921 (40% rent)
– Median household income: $65,086

Nevada: Washoe County

– Population: 479,758
– Median home value: $388,600 (58% own)
– Median rent: $1,251 (42% rent)
– Median household income: $74,292

New Hampshire: Rockingham County

– Population: 312,771
– Median home value: $367,300 (78% own)
– Median rent: $1,371 (22% rent)
– Median household income: $101,683

New Jersey: Somerset County

– Population: 343,950
– Median home value: $444,700 (76% own)
– Median rent: $1,722 (24% rent)
– Median household income: $121,695

New Mexico: Los Alamos County

– Population: 19,169
– Median home value: $343,100 (74% own)
– Median rent: $1,143 (26% rent)
– Median household income: $123,677

New York: Nassau County

– Population: 1,391,678
– Median home value: $560,100 (82% own)
– Median rent: $1,940 (18% rent)
– Median household income: $126,576

North Carolina: Wake County

– Population: 1,112,883
– Median home value: $324,500 (64% own)
– Median rent: $1,276 (36% rent)
– Median household income: $88,471

North Dakota: Cass County

– Population: 182,992
– Median home value: $244,000 (53% own)
– Median rent: $851 (47% rent)
– Median household income: $68,718

Ohio: Delaware County

– Population: 211,121
– Median home value: $336,600 (79% own)
– Median rent: $1,202 (21% rent)
– Median household income: $116,284

Oklahoma: Cleveland County

– Population: 292,110
– Median home value: $175,700 (64% own)
– Median rent: $979 (36% rent)
– Median household income: $67,068

Oregon: Benton County

– Population: 94,667
– Median home value: $384,900 (56% own)
– Median rent: $1,201 (44% rent)
– Median household income: $68,732

Pennsylvania: Montgomery County

– Population: 850,890
– Median home value: $338,800 (72% own)
– Median rent: $1,393 (28% rent)
– Median household income: $99,361

Rhode Island: Bristol County

– Population: 50,672
– Median home value: $379,000 (72% own)
– Median rent: $1,141 (28% rent)
– Median household income: $95,102

South Carolina: Greenville County

– Population: 519,178
– Median home value: $212,300 (69% own)
– Median rent: $1,011 (31% rent)
– Median household income: $65,513

South Dakota: Clay County

– Population: 14,816
– Median home value: $179,000 (54% own)
– Median rent: $725 (46% rent)
– Median household income: $56,077

Tennessee: Williamson County

– Population: 242,386
– Median home value: $497,500 (80% own)
– Median rent: $1,670 (20% rent)
– Median household income: $116,492

Texas: Collin County

– Population: 1,039,812
– Median home value: $355,100 (65% own)
– Median rent: $1,521 (35% rent)
– Median household income: $104,327

Utah: Cache County

– Population: 131,703
– Median home value: $283,800 (64% own)
– Median rent: $914 (36% rent)
– Median household income: $65,670

Vermont: Chittenden County

– Population: 167,523
– Median home value: $331,300 (63% own)
– Median rent: $1,386 (37% rent)
– Median household income: $81,957

Virginia: Loudoun County

– Population: 413,574
– Median home value: $569,100 (78% own)
– Median rent: $2,033 (22% rent)
– Median household income: $156,821

Washington: King County

– Population: 2,240,876
– Median home value: $651,900 (57% own)
– Median rent: $1,801 (43% rent)
– Median household income: $106,326

West Virginia: Monongalia County

– Population: 105,695
– Median home value: $221,600 (57% own)
– Median rent: $868 (43% rent)
– Median household income: $56,466

Wisconsin: Ozaukee County

– Population: 91,029
– Median home value: $305,700 (75% own)
– Median rent: $960 (25% rent)
– Median household income: $86,915

Wyoming: Albany County

– Population: 37,311
– Median home value: $247,100 (51% own)
– Median rent: $851 (49% rent)
– Median household income: $50,733