When Nader, a 41-year-old construction company employee in Tehran, shops for groceries, he constantly adjusts his list as he wanders the aisles, double-checking prices and factoring them into his budget. His basket keeps shrinking as inflation surges: A year ago, he gave up red meat, then chicken.

Now, with Nader’s savings gone and his rent having doubled, even cheese and eggs are becoming luxuries.

“I can’t keep up with the rising prices, no matter how hard I run,” said Nader, who moonlights as a taxi driver to afford clothes and schoolbooks for his son, in a telephone interview. “Our demand is for the government to fix the economy, to understand that we are breaking under financial pressure.”

Nader, like the tens of thousands of Iranians taking part in nationwide protests against the government in the past two weeks, has plenty of grievances to choose from: soaring prices, high unemployment, corruption, political repression and the law requiring women to dress modestly and cover their hair. That last issue set off the unrest when a young woman, Mahsa Amini, died two weeks ago in the custody of the morality police.

But the sorry state of Iran’s economy is one of the main forces spurring Iranians into the streets to demand change.

Armed with a sense of disillusionment over the failure of consecutive administrations to improve the economy, the protesters have chanted, “Death to the dictator,” calling for an end to Iran’s hard-line and inflexible clerical leadership and the Islamic Republic it built.

Economic despair is one factor unifying the government’s opponents and supporters. Abdolreza Davari, a conservative analyst, denounced the recent protests in a tweet this past week, but acknowledged that 95 percent of Iranians, regardless of their political views, were “worried about their livelihoods today and for their and their children’s future.”

Decades of mismanagement and corruption, compounded by two rounds of suffocating U.S.-led sanctions aimed at curbing Iran’s nuclear and missile programs, along with a pandemic, have frozen Iran’s economy at pre-2012 levels or worse.

Iranians who have spent the past several years cutting meat out of their budgets, scrounging for work and delaying marriage and children are angry — angry, by and large, with their leaders, whom they see as being responsible for the mismanagement of the economy.

Middle-class Iranians have had to reconfigure their lives. Many working-class people are falling below the poverty line. Businesses and livelihoods are going belly-up; rents have risen many times over. Foreign products and brands are vanishing from shops or growing eye-wateringly expensive. The Iranian rial lost so much value that Iran introduced a new unit of currency, the toman, essentially to slash four zeros off the bills Iranians carry in stacks to do their everyday shopping.

Educated young Iranians are unable to find jobs that match their degrees. Amir, 24, is an architecture graduate who sells clothes in a Tehran mall. Most of his classmates from engineering school are working as shop clerks or taxi drivers, he said. (Like other Iranians interviewed for this article, he asked that his last name not be used for fear of retribution.)

Living with his parents because he could not afford rent, he said he could not imagine ever renting an apartment, buying a car, getting married or having children.

“For most of us, normal milestones in life seem like out-of-reach dreams,” said Amir. “Maybe the only way out is to leave Iran.”

In 2015, there was a flash of optimism after Iran struck a deal with the United States and other world powers to limit its nuclear program in exchange for sanctions relief.

Some foreign investments and partnerships were on the way. But in 2018, before the economy had a chance to recover, President Donald J. Trump exited the nuclear deal and imposed a “maximum pressure policy” of aggressive sanctions, targeting oil sales and international financial transactions. Most foreign companies pulled out of Iran, fearing secondary sanctions by the United States.

“Iranians aren’t really looking at just whether they’re better off compared to last year,” said Esfandyar Batmanghelidj, the founder of Bourse & Bazaar, a research group specializing in Iranian politics and economics. “The thing that’s been weighing on everyone is, essentially, the country’s been stagnant for almost a decade.” He said people were asking, “‘Why has our economic welfare not improved in a meaningful way in a decade?’”

Grievances sparked by soaring prices and the economy’s sluggishness led to widespread protests against the government in 2017 and 2019, mostly in working-class and lower-income areas. Some demonstrators called for the overthrow of Iran’s supreme leader, Ayatollah Ali Khamenei, and were violently suppressed.

Inflation raged at 30, 40, then 50 percent. Iranians now pay about 75 percent more for food than they did a year ago. Iran’s Ministry of Labor and Social Services said in an August 2021 report that one out of three Iranians, or nearly 30 million people, live in poverty.

Houri, 60, a retired government employee in Tehran, said that with her fixed income, she had to think twice before engaging in once-routine activities like visiting her sister across town. Two round-trip taxi rides a week, she said, and a third of her pension is gone. At increasingly rare family gatherings, the once-lavish spreads have dwindled to tea and simple cookies.

“We are getting by with a lot of difficulty,” she said. “Every supermarket trip is a struggle.”

The accelerating misery — and the ever-bleaker prospects — have led to an exodus of people from Iran. Though well-educated Iranians had been leaving the country ever since the 1979 Islamic Revolution, the trend accelerated amid the recession and the Covid-19 pandemic. Medical workers and young Iranians who left to study abroad and stayed there were especially likely to abandon Iran.

As the new sanctions bit, Iran’s leaders remained defiant, declaring the advent of a “resistance economy” that would make the country more self-sufficient and less reliant on imports and oil sales. The government invested in domestic industries, urging Iranians to buy local. It also continued to evade sanctions by selling its oil to China at a discounted rate.

Such measures helped the economy stagger to its knees, growing more than 4 percent in 2021. Inflation has slowed slightly in recent months.

But for many Iranians, that has done little to offset years of turmoil and suffering. Many have lost faith in the system as successive rounds of elections have failed to deliver the political, economic and social reforms they have demanded, leaving protest their only option.

President Ebrahim Raisi, an ultraconservative who took office last year after an election in which most other viable candidates were disqualified, promised to lower inflation to the single digits within a few years, jump-start growth and create nearly two million jobs by March 2023. His “economic surgery” plan, many economic analysts say, has led to more inflation and a reduction in purchasing power.

To analysts, and many Iranians, one way to improve the economy seemed clear: Revive the nuclear agreement with the West.

But with Iran and the United States still haggling over terms, it remains unclear whether a deal will ever be reached. Every announcement of progress or deadlock in the talks causes fluctuations in the currency, a barometer of Iranian optimism.

Analysts say a new agreement would quickly benefit the country: billions of dollars of oil revenue abroad would be unfrozen, and its oil and gas could be sold on global markets again. But for ordinary Iranians, economic prosperity would still require overcoming systematic mismanagement and corruption.

Some in Tehran argue that the advantages of a deal are worth seizing, especially at a time when Iran has shown it can withstand harsh sanctions. But the government appears to be in no rush to strike a deal without securing significant concessions.

“What the nuclear deal would do is deliver some really clear benefits economically, and give the government a significant amount of breathing space,” said Henry Rome, the deputy head of research at the risk consulting firm Eurasia Group, who specializes in Iran. But, he said, Iran “is trying to make do without it, and, predictably, that’s having pretty significant costs, even if they’re able to muddle through for the time being.”

In the meantime, ordinary Iranians are enduring the pain.

In the past year or so, protests have erupted over water shortages in Isfahan and Khuzestan and over the price of staples like pasta, bread and cooking oil. (Those ended only when the government hastily began handing out cash.) Teachers, public sector workers, bus drivers and bazaar merchants have all protested over pensions, payments or prices in the last year.

When news broke of Ms. Amini’s death, many Iranians were ready, once again, to protest.