With the cost of Manhattan rentals skyrocketing, what do you do if you can’t afford one?

For a growing number of New Yorkers, especially those looking for smaller apartments, the answer is: Buy.

In fact, in the first quarter of this year, sales climbed for entry-level apartments, which accounted for more than half of all sales, according to Prudential Douglas Elliman. For those with good credit, low interest rates trumped high rents.

One happy would-be-renter-turned-buyer is Ian Jopson, a 49- year-old interactive designer for Fox News Digital.

Last summer, Jopson decided to leave Park Slope, Brooklyn, and rent a studio in Manhattan. But his search turned up nothing in his price range — $1,800 to $2,300 — that fit his requirements.

“The rents landlords were asking were ridiculous,” Jopson said. “I needed light, I needed a great bathroom. Everything was literally a hovel.”

Jopson’s real estate broker, Robert Ferri of Citi Habitats, recommended that he consider buying.

“I crunched the numbers and showed him we could bring his monthly payment in line, if not less than what his rent would be.”

Jopson ended up purchasing an alcove studio in the heart of Chelsea with an exposed brick wall, fireplace and renovated bathroom.

He paid $385,000. After putting down 20%, his monthly charges are $2,200, before his tax deductions for maintenance and mortgage interest.

“There is no way in hell I would able to rent the studio I bought,” Jopson said.