There are more medical doctors in the top 1% of earners than any other profession. The average salary of family and general practitioners nationwide is $192,120. Doctors who choose to specialize can earn even higher salaries. Anesthesiologists, for example, are among the highest paid medical professionals, earning about $258,000 a year on average.

The average annual salary of a primary care physician varies by more than $90,000 between states. To identify the states where doctors earn the most and the least, 24/7 Wall St. reviewed the average annual salary of family and general practitioners in every state. Doctors in Alaska earn the most with an average annual salary of $235,600. In contrast, physicians in Oklahoma earn $144,100 a year, the lowest of any state.

40. Michigan

> Avg. salary, doctor: $174,360
> Avg. salary, all jobs: $46,310 (20th highest)
> Doctors per 100K: 80.4 (18th highest)
> Cost of living: 5.9% lower than nation

Doctors’ average earnings do not necessarily correlate with overall earnings in a state. Rich and poor states are found on both sides of the doctor pay spectrum. Notably in Mississippi — the poorest state in America where the average salary across all jobs is just $37,620 a year — the average physician salary is the fifth highest of all states.

Every state could use more doctors. The Health Resources and Services Administration sets thresholds for provider-to-patient ratios. These thresholds indicate states with a doctors shortage. Twelve states have less than 50% of the primary doctors necessary to meet the needs of residents.

Because of the shortage, physicians can choose where to practice with relative ease, compared to many other professions. Similarly, high pay in a state can attract doctors who may not otherwise have considered practicing there. For example, doctor pay is highest in the remote state of Alaska, while states with traditionally high-paying jobs such as New York and California, that are perhaps more desired locations, physician salaries are lower.

The high salaries among medical doctors come at high cost. The typical graduate of a medical school in 2015 had accumulated $183,000 in student debt. While many factors contribute to a doctor’s decision where to practice, such a large amount of debt can entice doctors to choose to practice where they would be paid most.

A large medical student population in a state can also drive earnings for doctors down. Graduating medical students are more likely to stay in the state where they went to school, and with a higher supply of available doctors, pay often decreases. West Virginia, Vermont, and Missouri are the three states with the most medical students per capita. All three are among the 10 states paying doctors the least.

To determine the states with the highest and lowest paid doctors, 24/7 Wall St. reviewed 2015 average annual salaries of family and general practitioners in every state using data from the Bureau of Labor Statistics’ Occupational Employment Statistics survey. The average 2015 salary for all occupations is also from this BLS survey. Cost of living figures are 2014 state level regional price parities from the Bureau of Economic Analysis. The number of doctors per 100,000 residents in 2013 were obtained from County Health Rankings & Roadmaps, a collaboration between the Robert Wood Johnson Foundation and the University of Wisconsin Population Health Institute. All data are for the most recent period available.

Click here to see the states with the highest and lowest paid doctors.