This is a question this often on the minds of buyers. Buyer's want to be sure they are to not going to lose their earnest money.
What is earnest money anyway? It's like a deposit to show the seller that you really interested (earnestly) in buying their property. It's usually in the form of check made out to the escrow company and held in trust accounts until the transaction closes. It can be in the form of promissory note or anything else the seller is willing to accept. The full amount of the earnest money is credited toward the purchase price of the property at closing. There is no standard amount of earnest money, it's commonly about 1 percent of the purchase price. If the buyer really wants to impress the seller they will make it a lot higher to show them that they are really earnest about purchasing their property. Or make it nonrefundable after certain conditions are met.
As far as getting the earnest money back goes, as long as the buyer is careful about meeting contract deadlines the earnest money is usually safe or refundable. As a buyer you must be aware that you need to apply for financing (if there's a financing contingency) within five days of mutual acceptance (that's the date all timelines run from.) You to have your home inspection and response to the seller within ten days. Usually the the first ten days is the easiest time to get your earnest money back because of that inspection contingency. The contingency is subjective and you don't like something in the inspection report or even the color of the front door, you can check the box on the inspection response that says "Buyer' s inspection of Property is disapproved and the Agreement is terminated. The Earnest Money shall be refunded to the buyer." As you can see you don't even have to give a reason.
After this ten days of buyers earnest money is usually in jeopardy of being forfeited to the seller.
There are other circumstances where a buyer can get their earnest money back. If there is a financing contingency and within 30 days the lender turns the buyer down for a loan they can get their earnest money back. If the appraisal doesn't meet the purchase price and the seller is not willing to reduce the price or the buyer and seller can't come to some new agreement based on appraisal the buyer can get the earnest money back.
If the contract runs until closing and the buyer decides to walk away at the last-minute and go to Costa Rica instead of purchasing the property, the seller is surely going to keep the earnest money.
If you have any other questions about earnest money or anything else to do with real estate feel free to give me call at 360-739-6981