Anyone looking for a place to live right now is navigating one of the toughest and most expensive housing markets in recent history.

The pandemic boom in housing pushed home prices to an all-time high of $375,300 in March, 34% higher than the median price of $280,600 in March 2020, according to the National Association of Realtors. And in recent months, mortgage rates have been on the rise with the average rate for a 30-year fixed rate mortgage climbing above 5%. That has made the cost of financing a home about 40% more expensive than it was a year ago.

While rents in some big cities cratered early in the pandemic, they have largely rebounded and in many places have surpassed pre-pandemic levels. The median rent is up nearly 20% from two years ago, with asking rents in the largest housing markets reaching a record $1,807 a month in March according to Realtor.com.

All of these rising costs can make deciding whether to rent or buy a dizzying debate.

“Buy now before mortgage rates go any higher and begin to build equity!,” your buy brain says. “Maintain financial flexibility and keep your costs of getting in and out lower!” the voice urging you to rent says.

There are arguments for “waiting it out” until prices stop rising so fast. But for most people, housing is not a discretionary need, it is a necessity.

Ultimately, the decision comes down to where you live, your financial fitness, how long you plan to live in the home and what your cash flow looks like. Here are some questions you can ask yourself to help you choose between buying and renting.

Where do you live?

In more than half of the 50 biggest US cities, the monthly cost of buying a starter home was more affordable than renting a similar-sized unit, according to a report from Realtor.com released earlier this year.

But given the rapid spike in home prices, there are some areas where it is more affordable to rent than buy.

Austin, Texas, for example, is where it was most beneficial to rent rather than buy in January. It was followed by New York; San Francisco; San Jose, California; Seattle; Boston; Denver; Rochester, New York; Portland, Oregon; and Los Angeles.

In these 10 cities, the monthly payments associated with buying a starter home were 42% – or $978 higher – than rents, on average. For-sale starter homes in those places included a higher average share of condos than the national rate, and pricier homeowner association fees.

Places where buying was more beneficial than renting included Birmingham, Alabama, where the cost of buying a starter home was 44.3% less than the cost of renting in January. It was followed by Cleveland, Pittsburgh, and St. Louis.

Two cities in Florida – Tampa and Orlando – saw some of January’s fastest annual rent growth, which made buying more attractive even though home prices and mortgage rates were on the rise.

Are you financially fit?

The decision between renting or buying for most people is less about home prices or rents and more about whether you’re ready to be a homeowner.

What does your savings look like after a down payment is taken out? What is your credit score? Do you qualify for a mortgage? Can you make the monthly payments?

Andrew Dressel, a financial planner with Abundo Wealth in Minneapolis, likes people to have six months of expenses saved up in an emergency fund, $10,000 in cash to cover closing costs and moving expenses, and a credit score of 720 or higher when looking to buy.

“The emergency savings is of high importance and the 720 credit score has more wiggle room,” he said.

In addition, the overall cost of owning the home – including the mortgage and utilities, taxes, maintenance of appliances and the yard and the expense of everyday wear and tear – should not exceed 40% of a person’s take-home pay, he said.

“They need to also make sure they are not sacrificing their retirement or other goals just to own a home right now,” Dressel said.

How long will you live there?

If you only plan to live somewhere for two or three years, experts generally recommend renting.

If you’re feeling overwhelmed or rushed by purchasing in some hectic markets with low inventory, renting is not a bad place to land if it’s only for a year or so, said Jay Abolofia, a certified financial planner with Lyon Financial.

He dismissed the sense of urgency many potential buyers are feeling to lock in mortgage rates before they rise higher, saying that interest rates and home prices often have an inverse relationship.

“When interest rates are lower, that puts upward pressure on housing prices,” he said. “Just because interest rates are low doesn’t mean it is a good time to buy and higher interest rates doesn’t mean it is a bad time to buy a home.”

But, Abolofia said, it is always a good time to buy if you’re planning on staying there for a while.

Cross check yourself by asking if you’re being too conservative about how much house you should buy, said Leonard Steinberg, an agent at Compass in New York.

“You should be conservative enough that you can sleep at night and eat,” said Steinberg. “But many people are too conservative.”

He said he often sees people buy homes that are too small and, after a few years, they realize the space isn’t working for them.

“Now they have the costs of selling and buying again,” he said, which includes closing costs, inspections, appraisals and realtor’s commissions. “Moving a lot is expensive.”

What are your monthly payments?

As a homeowner you will need to do the math on what your cash flow will look like with monthly mortgage payments, the money needed up front to complete the transaction and the amount you’ll need to maintain it.

There is no sense in rushing into homeownership before you can comfortably cover those costs, said Noah Damsky, a chartered financial analyst with Marina Wealth Advisors in Los Angeles.

Damsky recommends that your monthly mortgage payment should not exceed 35% of your gross income. But that is the upper end. Other models are more conservative and suggest 25%, in order to keep your debt-to-income ratio lower. A middle-ground recommendation would be to put no more than 28% of your monthly gross income toward your mortgage payment.

And while some potential buyers may look forward to the tax benefits of homeownership – including deducting mortgage interest, property tax payments and other expenses from their federal income tax bill – Damsky cautions not to go overboard.

“I try to temper their expectations by explaining that the tax benefits will often be substantially offset by a roughly 1% annual maintenance cost.”

And they should be warned: The out-of-pocket costs of caring for a home could be even more, said Matt Hylland, a financial planner at Arnold and Mote Wealth Management in Cedar Rapids, Iowa. He advises home buyers to budget 2% to 3% of the home’s value to cover upkeep and maintenance.

“Making sure you find a monthly payment that you can afford is important,” said Hylland. “But don’t forget to add to that other expenses you will face as a homeowner.”