State capitals aren’t just for lawmaking. Often, they’re thriving cities with a lot of economic and cultural value. In fact, they can be some of the best places to live in America. But not all state capitals are created equal. And though 17 of them are the largest cities in their states, the biggest population doesn’t always represent the best quality of life. Some have rampant poverty problems. For example, more than 30 percent of the population of Harford, Conn., lives in poverty, compared to 12.7 percent of the entire U.S.

In order to determine which state capitals make the best homes, WalletHub compared all 50 across 51 key indicators of affordability, economic strength, quality of education and health, and overall living standards. Our data set ranges from cost of living to K–12 school-system quality to number of attractions. Read on for our findings, expert insight from a panel of researchers and a full description of our methodology.

For a full explanation of the methodology, go here.

Madison, Wis., was second with a State Capital Index of 64.67 that included an Affordability rank of 26, Economic Well Being rank of 6, Qualify of Education & Health rank of 1, and Quality of Life rank of 5.

This picture shows downtown Madison.

Boise, Idaho, was third with a State Capital Index of 63.15 that included an Affordability rank of 8, Economic Well Being rank of 11, Qualify of Education & Health rank of 8, and Quality of Life rank of 9.

A view of the Idaho state Capitol building on Monday, Jan. 11, 2016 in Boise, Idaho.

Lincoln, Neb., was fourth with a State Capital Index of 63.03 that included an Affordability rank of 9, Economic Well Being rank of 8, Qualify of Education & Health rank of 4, and Quality of Life rank of 18.

A pedestrian walks past the Nebraska State Capitol building in Lincoln, Neb., on Wednesday, Jan. 4, 2017. 

Bismarck, N.D., was fifth with a State Capital Index of 61.63 that included an Affordability rank of 3, Economic Well Being rank of 1, Qualify of Education & Health rank of 21, and Quality of Life rank of 36.

This photo, taken Thursday, April 19, 2012, shows the North Dakota Capitol tower behind a large stone identifying sign. 

Raleigh, N.C., was sixth with a State Capital Index of 60.89 that included an Affordability rank of 4, Economic Well Being rank of 10, Qualify of Education & Health rank of 16, and Quality of Life rank of 23.

This July 24, 2013 photo shows the North Carolina State Capitol in Raleigh, N.C. 

Denver, Colo., was seventh with a State Capital Index of 60.53 that included an Affordability rank of 41, Economic Well Being rank of 7, Qualify of Education & Health rank of 12, and Quality of Life rank of 3.

The Colorado state Capitol building in Denver, Colo., on Thursday, Jan. 4, 2018. 

Salt Lake City, Utah, was eighth with a State Capital Index of 60.47 that included an Affordability rank of 16, Economic Well Being rank of 12, Qualify of Education & Health rank of 11, and Quality of Life rank of 11.

A television crew stands on the top steps of the State Capitol, Thursday, Jan. 3, 2008, in Salt Lake City. 

Juneau, Alaska, was ninth with a State Capital Index of 58.27 that included an Affordability rank of 15 Economic Well Being rank of 2, Qualify of Education & Health rank of 17, and Quality of Life rank of 37.

The front entrance of the Alaska state Capitol building on Monday, April 2, 2012, in Juneau, Alaska. 

Concord, N.H., was 10th, with a State Capital Index of 58.25 that included an Affordability rank of 6, Economic Well Being rank of 13, Qualify of Education & Health rank of 22, and Quality of Life rank of 31.

The New Hampshire statehouse in Concord, N.H., is shown in this July 20, 1999, photo. It is the oldest state capitol where the legislature still meets in its original chambers.Â