A home’s price is a moving target—based on where it is, when it’s listed for sale, whether it has that trendy open kitchen, all of it. So if you’re tasked with pricing your own home before putting it on the market, how do you figure out how much your place is worth?

Home sellers pondering this question will no doubt hear they should figure this out by asking a real estate agent for a comparative market analysis, or CMA. But what is it? A comparative market analysis estimates a home’s value based on the recent sales of similar real estate in the area.

Whether you’re hoping to buy a house or sell one, understanding the CMA is essential. Here’s everything home buyers and sellers need to know.

Comparative market analysis (CMA) explained

Real estate agents create CMAs by looking at comparables, or comps—recently sold properties that are similar to your own home (or, if you’re a home buyer, the one you want to make an offer on). Similarity is key, since it gets you closest to an apples-to-apples comparison.

Let’s say your own home has three bedrooms, two baths, and is around 2,000 square feet. Your neighbor’s down the block is also a three-bedroom, two-bath house clocking in at 1,950 square feet—and it sold last week for $300,000. Odds are, your place is worth about that same price.

“Comparable homes should be in the same or similar neighborhood, have similar square footage, number of bedrooms, bathrooms, features, and upgrades,” explains Shayan Jalali, a pricing strategy adviser with Berkshire Hathaway HomeServices in Boston.

But since most houses are at least a little bit unique, how identical do they need to be?

Tristan Ahumada, CEO of Lab Coat Agents, says comps should ideally have the same number of bedrooms and bathrooms, be located within a quarter-mile of your home, and within 200 square feet of your home’s size. Whenever possible, they should be in your ZIP code and school district too.

It’s also important to make sure your CMA analyzes recent sales. Markets can change quickly, so Ahumada advises not going back any more than six months.

Another rookie mistake? Looking at listing prices on homes and assuming those are realistic comps. Those numbers may be inflated based on home sellers’ hopes of what they’ll get rather than reality.

“Or, in really competitive markets, agents purposefully underpricing their listings to generate more interest,” says Beatrice de Jong, director of residential listings at Open Listings in Los Angeles.

Bottom line: CMAs should take into account the final sales prices of homes.

The more comps you use, the better you can triangulate a home’s price, but if you have at least three comparable, recently sold properties, you should be able to average out their prices and get a good sense of what a given home is worth.

Why to ask real estate agents for CMAs

Most real estate agents will provide you with a CMA for free, especially if you are selling your home. In fact, comparing CMAs is a great way to find the agent you want to work with. Ahumada encourages potential clients to get market analyses and conduct interviews with at least three different agents before signing with one.

“It will help you really spot the agents who know the area well,” he explains.

According to Ahumada, most agents should be happy to email you a CMA before you even sit down to have a conversation. Consider it a good kickoff to your working relationship and a way to find the right real estate agent (search your options at realtor.com/realestateagents).

How to do your own comparative market analysis

While your real estate agent can do a CMA for you, you might want to do your own analysis. You can find comps by searching for recent home sales in your area on listing sites such as realtor.com.

One way to quickly assess how much a house is worth is to use an online home value estimator. You plug in an address, and within seconds, a computer algorithm will scan comps, crunch the numbers, then deliver an estimate of how much the house in question is worth.

While online home value calculators are a great starting point, they aren’t the end all, be all. Like any fully automated tool, they can’t take everything into consideration that a human could. Consider it your springboard for further research you or a real estate agent can explore further.

Taking condition into consideration

OK, so you’ve found your recently sold comps, and hopefully they match up with the property you’re analyzing. The more nuanced bit is taking things like condition, lot size, extras, and curb appeal into consideration.

“You can’t compare a fixer-upper to something with lots of upgrades,” says de Jong. Ideally, you will be able to find comps in a similar condition to the house you’re trying to price—but if not, be wary of just adding the full cost of your remodeling to a home’s price.

In other words, just because you spent $10,000 installing an in-ground pool does not mean home buyers are willing to pay you $10,000 more. On average, homeowners should expect to make back only about 56% of the money they spend on renovations, and that return on investment varies widely based on what you do (here’s the ROI on 20 popular home improvements).

De Jong also encourages people to try to find comps with a similar home style. In her market, for example, trendy midcentury modern homes bring a higher price.

Some market knowledge is harder to DIY. Every area will have different things that are desirable, and upgrades and extras will be worth more in some areas than others. In California, for example, Ahumada estimates that a high-end kitchen remodel adds between $20,000 and $40,000 to a home’s price. But if you’re doing a CMA for an area where home prices average $150,000, those numbers are going to be much lower.

Going beyond comps

Still not sure you’ve done enough homework? Another tactic to further hone your CMA is to ask your real estate agent to contact other agents to get the scoop on homes that aren’t sold quite yet, but are currently waiting to close.

“If a house is in escrow, you can reach out and find out how much higher or lower than asking the house went for,” says de Jong. Getting the inside scoop can give you an edge with pricing, and give you a heads-up about potential bumps down the road. For example, did a comparable home have multiple offers? Did the buyer have any appraisal issues? Did the seller have to give any concessions to push the deal through?

All of this can give you an up-to-the-minute snapshot of where the market is headed. It can also explain weird or lowball comps that pop up, throwing off your price.

“Recently, there was a home that sold for 5% less than other homes in the neighborhood. After calling the listing agent, we found that the buyer paid all cash and closed in two weeks,” recalls Allen Johnson, a real estate agent in Woodbridge, VA. “You could have easily used this property as a comparable home, but these details certainly affected the final sales price.”

As featured on realtor.com