ASTORIA — Comparing home prices with rents, Clatsop County is the number 1 county in Oregon when it comes to making sense to buy, according to an analysis by SmartAsset, a New York financial technology company.

Based on the company’s computations, the average monthly mortgage payment in the county is $843 and the average home price is $207,961. In contract, the average monthly rent is $1,217.

SmartAsset’s interactive buy vs. rent map (tinyurl.com/jkr5o9d) highlights the places where buying a home is better than renting based on the number of years you plan on staying in your home. In Oregon, Clatsop tops the places where buying becomes a better financial option than renting in the shortest amount of time.

It takes 3.1 years for a home purchaser in Clatsop County to break even with renting, SmartAsset says.

Yamhill County is second and Curry County is third. Buying makes the least sense in Hood River County, where a home purchase takes more than five years to pay off compared to renting.

“The decision to rent or buy a home can be a challenging one for anyone looking to move,” the company said. “The second annual study compares average rent and home prices in counties across the U.S. to find the places where buying makes the most sense.”

Across the Columbia River, Pacific County ranks 15th among Washington’s 39 counties in terms of buying versus renting. With an average mortgage payment of $761, average home price of $187,792 and average rent of $1,083, it would take five years to break even between buying and renting, according to SmartAsset. Just north on the Pacific Coast, Grays Harbor County’s dramatically lower average home price — just $136,313 — but relatively high average rent of $1,028 means it is in second place statewide as a place buy instead of rent.

San Juan County is Washington’s least affordable place, with an average home price of about $314,000 versus an average rent of $1,414. It would take 8.1 years to reach break even.