In most cases, yes, you can get your earnest money back if your mortgage loan is denied, as long as your purchase contract includes a financing contingency (sometimes called a mortgage or loan contingency) and you cancel the deal within the timeframe that contingency allows. This clause is standard in the majority of residential purchase contracts and exists specifically to protect buyers who are acting in good faith but can't secure financing.
The financing contingency typically gives you a set number of days, often 21 to 45, to apply for and obtain loan approval. If your lender denies the loan within that window and you notify the seller in writing before the deadline, you're entitled to cancel the contract and have your earnest money returned. The seller cannot keep the deposit simply because the deal fell through, since the contingency makes financing a condition of the sale, not a guarantee.
Problems arise when buyers miss the deadline or fail to act diligently. If the contingency period expires before your loan is denied, or if the lender denial letter shows you dragged your feet, missed document requests, or changed jobs or made large purchases mid-process, the seller may argue you didn't act in good faith. In that scenario, your earnest money could be at risk, and disputes sometimes end up in mediation or small claims court.
The type of denial matters too. A straightforward denial because the lender's underwriting simply couldn't approve you, despite your reasonable efforts, is the classic scenario the financing contingency protects. But if you were denied because you lied on your application, stopped communicating with your lender, or deliberately let the loan fall apart to get out of the contract for an unrelated reason, sellers and their agents may challenge the refund.
To protect yourself, keep every piece of paperwork: your pre-approval letter, all lender correspondence, and especially the official denial letter, which should state the reason for denial. Submit your cancellation notice in writing, referencing the financing contingency clause by name, and do it before the contingency deadline, not after. If you're getting close to the deadline and still waiting on an underwriting decision, ask your real estate agent to request a written extension from the seller rather than letting the contingency lapse.
If you waived the financing contingency to make your offer more competitive, which happens often in hot markets, you likely have no automatic right to your earnest money back if the loan falls through. That's one of the biggest risks of a non-contingent offer, and it's worth discussing carefully with your agent and lender before you sign.
Earnest money is usually held by a neutral third party, such as a title company or escrow agent, who releases it only when both buyer and seller agree or when a court or arbitrator orders it. If a seller refuses to sign a release despite a valid loan denial, your agent or a real estate attorney can help you formally demand the funds or pursue a legal remedy.