Oakland, Richmond and El Cerrito are among 18 California cities at high risk for serious financial problems in the next few years, according to a study released Thursday by the state auditor’s office.

The study, which ranks the fiscal health of 471 cities in the state, is the basis of a new website that allows anyone to get an inside look at municipal finances, said State Auditor Elaine Howle.

“The cities are ranked in three buckets: red for serious risk, yellow for moderate risk and green for low risk,” she said in an interview before the website’s launch. It’s “aimed at regular people, but (is) also for financial people who want to drill down deeper” into a city’s finances.

Although San Francisco and most other Bay Area cities fall in the moderate risk range, the state auditors found San Jose right on the edge, ranking 23rd in the state, just behind the 18 “code red” cities.

Those 18 include El Cerrito at No. 7, Richmond at No. 12 and Oakland at No. 13.

El Cerrito and Oakland have dangerously low financial reserves and crushing pension obligations, the auditor’s office found. Richmond has the same problems, along with a high debt total, the state said.

Cities are legally obligated to pay pensions and other benefits to municipal retirees, regardless of whether it pinches the government financially. That means the money has to come from somewhere — usually from cuts to services that affect everyone in the city, including public safety, libraries, parks and street maintenance.

In a Sacramento news conference Thursday, Howle singled out Oakland for the profile of a troubled city.

“Only one of the 10 indicators is green and multiple indicators are red,” she said. “That shows real trouble for Oakland.”

Oakland City Administrator Sabrina Landreth called the analysis “a blunt tool that doesn’t account for each jurisdiction’s unique and complex financial situation. ... That said, it does highlight the challenges many California cities, including Oakland, are facing related to pension obligations and retiree medical benefits.”

Richmond’s dismal numbers aren’t a surprise, but things are changing, said interim City Manager Steven Falk.

“We aren’t going to pretend Richmond doesn’t have financial challenges,” he said. “But the city has taken steps to shore up its finances ... and work our way to have more green and yellow boxes on that chart.”

El Cerrito officials did not respond to numerous requests for comment.

Compton in Los Angeles County was ranked at the top of the auditor’s list of financially troubled California cities, followed by Atwater near Merced in the San Joaquin Valley and Blythe in the desert in Riverside County.

The Bay Area’s most financially secure city was Lafayette, ranked 469th of 471.

A team at the auditor’s office has been working on the website project for more than a year, pulling together financial reports and other information. But not even the cities knew what their rankings were until the website went live Thursday morning.

“We have not reached out to the cities in advance, so we will get howls,” Howle said. “We fully expect cities to call us, which means (the website) is a success in starting conversations.”

There are also likely to be discussions between city officials and residents who suddenly have easy access to information about local finances.

“We hope this will lead people to ask questions,” Howle said.

While the Legislature gave Howle the power to conduct individual city audits, the website was her idea.

“We figured this could be tremendously valuable for the state of California” and provide more financial transparency for the state’s cities, she said. “We’ll be continually adding data so we can see trends, what’s getting better and what’s getting worse.”

The ratings are based on 10 financial indicators, including city debt, financial reserves, pension and retirement obligations and anticipated revenue. Each factor is assigned a point value, with a maximum total score of 100 for each city. High-risk cities scored at about 42 points or less.

“It’s somewhat comforting that we only have 18 cities at high risk,” Howle said. “But some cities at low risk might have areas where they are struggling.”

The website includes easy-to-understand descriptions of complicated fiscal concepts. The question of a city’s cash position and liquidity, for example, is defined by a simple question: “Is the city able to pay its bills in the upcoming fiscal year?”

For many cities, pension obligations and the cost of health and dental care for retired workers are a problem.

“A lot of cities face problems with pension and costs, where they haven’t set enough money aside for future obligations,” Howle said. That isn’t a surprise; the state is dealing with similar problems.

The data on the website are based on each city’s audited financial statement for the 2016-17 fiscal year, which is a problem in itself, the auditor said.

All but the 11 tiniest California cities are required to do an audited financial statement each year, but the state couldn’t get more recent statements from some cities.

The 2017-18 fiscal year closed more than a year ago, “so that statement should be done. But in some cases, it hasn’t been,” Howle said. Her office plans to release a list of the 60 or so cities that haven’t completed those reports.

John Wildermuth is a San Francisco Chronicle staff writer. Email: jwildermuth@sfchronicle.com Twitter: @jfwildermuth