Steven Birnbaum works with a patient in a CT scanner at Southern New Hampshire Medical Center in Nashua, N.H. (Jim Cole/AP)

People who live in San Francisco pay the most, on average, for a doctor’s visit ($251), and folks in Miami pay the least ($95). Indianapolis is the most expensive for a cholesterol test ($89) and Pittsburgh is the least costly ($19). And Sacramento comes in highest for both CT scans of the head ($1,404) and MRIs of the lower back ($2,635).

Those are the range of prices for four of the most common medical services in 30 of the most populous cities in the United States, according to an analysis by Castlight Health, a San Francisco-based company that works with employers on controlling health-care costs.

It has long been known there is huge price variation across the country for different kinds of medical services paid for by Medicare. Castlight said its report, released Tuesday, is the most comprehensive analysis of prices for people who have employer-covered insurance. Nearly 48 percent of Americans, or nearly 150 million people, are covered by employer-sponsored insurance.

And the reason for such a wide disparity in prices? It’s all about what providers can negotiate with insurance companies. Those with the biggest market share have the most clout, said Jennifer Schneider, an internist and vice president of strategic analytics at Castlight.

Other factors include the cost of living and the demographic profile of people in the different cities. The cost of living in San Francisco is very high; Floridians tend to be older and sicker.

Even within a geographic region, prices can vary dramatically. In Dallas, for example, the cost of a cholesterol test ranges from $15 to $343, a 23-fold differential.

Castlight gets the information from medical claims data provided by large employers. The prices represent what consumers pay.

Washington, D.C. falls in the middle. It is among the least expensive cities for the cholesterol test (average price $24); the 12th most expensive for preventive primary care visit ($141); 23rd for CT scan of head/brain ($681) and ranks 18th most expensive for MRI of lower back ($1,391).

Here are the top five cities for a preventive primary care visit (average price), ranked by most expensive to least expensive:

1. San Francisco ($251)

The price tag for medical care is dramatically higher in the U.S.

2. Sacramento ($219)

3. Portland, Or. ($216)

4. Minneapolis, MN ($209)

5. Charlotte, NC ($199)

And these are the top five most expensive cities for a cholesterol test (average price):

1. Indianapolis, In. ($89)

2. Kansas City, MO ($79)

3. Minneapolis, MN ($67)

4. Chicago, Il ($64)

5. Tampa, Fl. ($58)