A single hospital stay can cost a patient tens of thousands of dollars. This is driving many people to crowdfunding in order to pay for their medical bills.

If it weren’t for Medicaid, the parents of a 3-year-old child born with a rare disorder would have owed more than $200,000 for their son’s one-week stay in the hospital.

Last month the child’s mother, Alison Chandra, posted an image of the hospital bill on Twitter. She followed up with a summary of the details.

“I’ll save you some math; without insurance we would owe $231,115 for 10 hours in the OR, 1 week in the CICU, and 1 week on the cardiac floor,” she wrote.

Chandra’s son was born with heterotaxy syndrome, which required him to have four open-chest surgeries before his third birthday.

Chandra told the Philadelphia Inquirer that Medicaid picked up the tab for her prenatal care and her son’s first two surgeries. After insurance, they ended up owing $500.

Now, the family’s medical expenses are covered by insurance that her husband gets through his new job.

Without Medicaid, though, the parents might have ended up like many other Americans who file for bankruptcy each year due to overwhelming medical bills.

With complicated health problems that require intensive hospital care, medical bills can quickly add up.

In the United States, septicemia (blood poisoning) accounted for $23 billion in inpatient hospital costs in 2013, according to a report by the Agency for Healthcare Research and Quality. This represented 6 percent of all inpatient hospital costs for that year.

Other high-cost hospitalizations included newborn infant stays, complications stemming from osteoarthritis or a medical device, an implant or tissue graft, and acute heart attack.

However, when looking at the average cost per hospital stay, heart valve disorders topped the list at $41,878.

Heart attack and complications from a medical device, implant or tissue graft comes in at an average of about $20,000 per stay. Septicemia is about $18,000 per stay.

People with health insurance may never have to pay the full costs, even though they see the hospital charges on their medical bills.

But research last year from the University of Michigan found that for people with private health insurance, the out-of-pocket cost for a hospital stay was more than $1,000 in 2013. This was a 37 percent increase over 2009.

The rise was mainly due to increases in deductibles, or how much of the medical expenses someone has to pay before most services are covered by their insurance plan.

People also paid a larger percentage of their medical expenses after they met their deductible, a process known as coinsurance.

A 2015 study by the Kaiser Family Foundation also found that insurance premiums rose 4 percent over the past year. People with a plan that included coinsurance paid about 18 percent of the cost of primary care and specialty care visits.

When people lose their insurance coverage, they risk being slammed with medical bills.

This can happen when a person leaves a job due to illness, or other reasons like having to take care of a sick child or spouse.

A 2009 study published in The American Journal of Medicine found that almost two-thirds of bankruptcies in the United States had a medical cause.

About 78 percent of people had insurance at the start of the illness. By the time of bankruptcy, the share of people with private insurance had fallen, while those with Medicare or Medicaid had increased.

On average, uninsured families bankrupted due to medical expenses owed almost $27,000, while those with private insurance owed more than $17,000.

Families who started with private coverage, but lost it by the time of bankruptcy, ended up owing an average of around $22,000.

Hospital bills were the largest out-of-pocket expense for people who filed for medical bankruptcy, followed by prescription drugs, doctor bills, and insurance premiums.

In almost 40 percent of families, someone had lost or quit a job because of the illness. In one-quarter, a family member was fired as a result of the illness.

In recent years, there are signs that the Affordable Care Act (ACA) has eased some of the burden of medical bankruptcies.

A study earlier this year by Consumer Reports found that bankruptcy filings in the United States dropped 50 percent to 770,846 between 2010 and 2016 — the period during which the ACA has been in effect.

Experts pointed out that the improving economy and changes to the bankruptcy laws in 2005 contributed in part to this decline. But expanded healthcare coverage as a result of the ACA also had a major role.

Illness is a slippery financial slope, especially when your health insurance coverage depends on you — or another member of your family — to continue working during the illness.

According to a 2015 survey by the Robert Wood Johnson Foundation, more than one-quarter of American adults said that they have major financial problems as a result of healthcare costs.

That’s why some people are turning to crowdfunding sites to raise money to pay for their medical expenses.

Crowdfunding involves seeking donations from family, friends, and others through online campaigns. People use crowdfunding websites to raise money for creative projects, new businesses, and now healthcare costs.

A 2015 analysis by NerdWallet found that 41 percent of crowdfunding campaigns on four sites were for medical costs.

On crowdfunding site GiveForward, 70 percent of medical campaigns were for people recently diagnosed with cancer.

Out-of-pocket medical expenses account for the bulk of the crowdfunding requests, but people also seek money to cover transportation, child care, and lost wages.

Crowdfunding can work for some people, but it is no cure-all.

Only 11 percent of those campaigns analyzed by NerdWallet met their funding goal.

In a 2016 study, published in the journal Social Science & Medicine, University of Washington Bothell (UWB), researchers found similar success rates on GoFundMe. On average, 200 campaigns brought in only 40 percent of their funding goals.

That means some people may still be struggling to pay their medical bills.

Crowdfunding seems like the epitome of the free market system touted by many politicians. But the UWB researchers found that medical crowdfunding may simply be a symptom of inequalities in health insurance coverage in the United States.

About 54 percent of the medical crowdfunding campaigns they looked at were from people living in states that didn’t expand Medicaid as part of the ACA. These states account for only 39 percent of the country’s population.

The researchers also suggested that people who are successful at crowdfunding campaigns may not be the ones most in need.

Instead, people’s success at crowdfunding may depend on how comfortable they are with “self-marketing for financial survival,” as well as using online crowdfunding sites and social media.

The researchers wrote that this may “increase the likelihood that crowdfunding for healthcare is exacerbating severe population health disparities.”