The California legislature is working on a bill to provide publicly-funded healthcare to all residents. The costs are extreme, to say the least.

Some California politicians are hoping to accomplish something that Congress has failed to do — provide publicly-funded universal health care to all residents of the state.

This ambitious plan, though, has left many people reeling from sticker shock.

An analysis last month by the state’s Senate Appropriations Committee estimated that a single-payer healthcare system in the state would cost $400 billion a year.

Under bill SB 562, the state would cover the costs of medical care for all residents of California — including people without legal status.

This includes inpatient, outpatient, emergency services, mental health, nursing home care, dental, and vision. There would be no premiums, copays, or deductibles.

Around half of the money needed could come from existing federal, state, and local funds currently spent on healthcare. But the state would still have to find an additional $200 billion per year to fund this single-payer system.

A later study paid for by the California Nurses Association/National Nurses United — supporters of the new bill — estimated a total annual cost of $331 billion.

Either way, this is no small deal — it is twice the entire state budget proposed for the next fiscal year by Gov. Jerry Brown.

Read more: 14 million more people may not have health insurance next year »

Lawmakers have not decided on a way to pay for the new plan. But the analysis suggests that a 15 percent payroll tax on earned income would cover the increased costs.

Many have balked at the thought of new taxes.

However, the analysis points out that a single-payer system would reduce healthcare spending by employers and employees in the state, which is currently between $100 and $150 billion per year. And residents would no longer have to pay out-of-pocket for most of their healthcare.

According to the Commonwealth Fund, in 2015 annual family health insurance premiums in the United States averaged $17,322. California was slightly higher at $18,045.

People with employer health insurance policies paid 21 percent of this, on average. The rest of the cost was picked up by employers.

A report by healthcare market research publisher Kalorama Information found that in 2016, individuals spent an average of $1,400 out-of-pocket for health services.

A 15 percent payroll tax on someone making $60,000 per year would be $9,000. If this was split between employees and employer in the same way that health insurance premiums are now, employees may not feel much of a difference.

The analysis points out, though, that there are many unanswered questions.

“There is tremendous uncertainty in how such a system would be developed, how the transition to the new system would occur, and how participants in the new system would behave,” it noted.

Read more: Health organizations lash out at GOP healthcare bill »

Many other countries have versions of universal healthcare — or Medicare for All, as it’s sometimes known in the United States. These countries offer some hint as to how a California single-payer system might fare.

California has a population of 39 million, roughly the same as the 36 million in Canada, which has a publicly-funded universal healthcare system.

Canada doesn’t have a single national plan. Instead, each Canadian province and territory has its own health insurance program, with funding coming from the federal government.

In 2016 Canada spent $228 billion on healthcare. This comes out to $6,299 per person, or 11 percent of the country’s gross domestic product (GDP).

The average life expectancy in Canada in 2015 was 82.2 years, according to the World Health Organization (WHO).

With a $400 billion price tag, the California single-payer health plan would cost on average $10,191 per person — more than one-and-a-half times what Canadians spend. This is around 15 percent of California’s GDP.

California’s life expectancy was 80.8 years in 2009. The average U.S. life span is 79.8 years.

The cost of healthcare for all has been one of the biggest stumbling blocks to national efforts to implement this kind of program in the United States.

Advocates of single-payer health systems counter that expanding coverage to everyone would reduce administrative costs and profits inherent in the current public-private arrangement in the United States.

In a study earlier this year in the journal Annals of Internal Medicine, researchers “estimate that single-payer reform could save approximately $504 billion annually on bureaucracy.”

They also point out that hospital administrative costs in Canada and Scotland are around 12 percent of their revenue. In the United States they are over 25 percent.

Another study this year by RAND looked at various health insurance options for Oregon.

Researchers estimated that if a single-payer option were implemented in the state, every resident would have health insurance. Universal coverage would be especially beneficial to people with low to middle incomes.

Healthcare costs would remain largely unchanged. However, this would require cuts to provider payment rates, which might drive providers out of the state. In the end, this could worsen access to care.

Increasing health insurance coverage and access to quality healthcare is only one part of the equation. Another is the high cost of healthcare.

Overall, the United States spends more on healthcare than other high-income countries, but this doesn’t translate into longer life spans for all Americans.

A single-payer system may not immediately lower those costs, or address lifestyle factors like poor diet and lack of exercise that can lead to chronic diseases like obesity and heart disease.

These diseases lower life expectancy in the United States, but they also account for a large share of healthcare costs.

According to the Centers for Disease Control and Prevention (CDC), the costs in 2010 for heart disease and stroke alone were estimated to be $315.4 billion. The costs linked to obesity in 2008 were estimated at $147 billion.

There’s no guarantee that a single-payer system in California will solve all of these issues.

But if the state were able to pull it off, it will give health policy researchers more data to show what might work — and what doesn’t — in a country that has long resisted the worldwide universal healthcare trend.