☎ +1 214-659-1775 Signal: +1 214-659-1775 [email protected]
Mon–Fri 9:00–18:30 MT · Denver, Colorado

How to recover your corrupt or deleted Bitcoin Core wallet

David Veksler By David Veksler Jan 8, 2018 · Updated Jul 12, 2026 7 min read Guides

This guide covers every common way a Bitcoin Core wallet goes wrong — a deleted wallet.dat, a corrupt file that won't open, a restored backup that shows no balance, and very old wallets that modern software refuses to load. Litecoin, Dogecoin, Bitcoin Cash, and many other coins share Bitcoin Core's wallet format, so the same techniques apply to them. I assume you know the wallet password or there is no password — forgotten passwords are a different problem, covered on our forgotten wallet password recovery page.

This information is based on years of doing exactly this work for clients of my Bitcoin Core wallet recovery service. If you'd rather have it done for you — or your first attempt didn't work — request a free evaluation; there's no fee until your coins are back.

Before you try anything below: make one read-only copy of everything. Copy wallet.dat (if it exists) and, for deleted-file cases, stop writing to the drive entirely. Most of the unrecoverable cases I see were recoverable until someone's third or fourth experiment overwrote the data.

Where Bitcoin Core keeps your wallet

Locked out of a wallet like this one?

We repair hardware wallets, crack forgotten passwords, and rebuild broken seed phrases — on our own bench in Denver.

✓ NO FEE UNTIL YOUR CRYPTO IS BACK · FREE EVALUATION
Start a free evaluation →

The wallet lives in the Bitcoin Core data directory, unless you created it with a custom name or location:

Named wallets created in newer versions live in their own subfolder under wallets\, each with its own wallet.dat. If you "lost" your wallet after reinstalling or updating, check here first — uninstalling Bitcoin Core does not delete your wallet. The data directory survives reinstalls, and simply pointing a fresh install at it (or copying wallet.dat back in) restores everything.

Recovering a deleted wallet.dat

If the file itself was deleted, check for backups first: old external drives, cloud folders (Dropbox/Google Drive sync from years ago), email attachments to yourself, and the wallets/ folder of every computer you've owned. A wallet backup from years ago is still fully usable — old keys don't expire — though see the note about pre-2013 key pools below.

1: Undelete tools. Until the file is overwritten by new data, a deleted file is still physically on the drive. On Windows, Recuva is free; PhotoRec/TestDisk is free and cross-platform (Windows/Mac/Linux) and understands raw file signatures, which helps when the filesystem entry is gone. Run the tool from a different drive than the one you're recovering.

2: Volume Shadow Copies (Windows). Windows sometimes keeps automatic point-in-time copies as part of restore points. Right-click the folder that contained the wallet → Properties → Previous Versions, or use a tool like ShadowExplorer to browse old snapshots.

A hard truth about SSDs: on a modern SSD, the TRIM command usually erases deleted data within minutes — undelete tools that work well on spinning hard drives mostly fail on SSDs. Deleted-wallet recovery from an HDD is often successful; from a TRIM-enabled SSD it rarely is. This is exactly the case where you should stop and get a professional evaluation before running more tools against the drive.

Formatted drives: a "quick format" only rewrites the filesystem table, and file-signature scanners like PhotoRec can often still find the wallet. A full format or a zeroed/encrypted-then-reset drive is generally not recoverable by software.

"ERROR: wallet.dat corrupt, salvage failed" — fixing a corrupt wallet

Corrupt Bitcoin Core wallet.dat file illustration

Corrupt wallets are usually the product of interrupted writes, failing drives, or a partially-overwritten file recovered by an undelete tool. Bitcoin Core may refuse to start, or fail with "error loading wallet.dat" or "ERROR: wallet.dat corrupt, salvage failed." You have several options, in increasing order of difficulty:

1: Bitcoin Core's own salvage. Old versions had a -salvagewallet startup flag. In current releases that flag is gone; salvage moved to the bitcoin-wallet command-line tool that ships in the same folder as bitcoind:

bitcoin-wallet -wallet=wallet.dat -dumpfile=dump.txt dump

or, to attempt an in-place repair on a copy of the file:

bitcoin-wallet -wallet=/path/to/copy-of-wallet.dat salvage

Salvage scans the Berkeley DB file for intact key records and rebuilds a wallet from whatever it can read. It's the first thing to try and works on mildly corrupted files.

2: Dump the keys with pywallet.

python pywallet.py --dumpwallet > wallet.txt

Then find the address holding your Bitcoin and sweep its private key into a fresh wallet. Warning: trojaned copies of pywallet have circulated — download only from the original repository, verify what you're running, and work offline.

3: Extract keys with bitcoinj's wallet-tool — useful when pywallet chokes. If the wallet is encrypted, decrypt a copy first:

openssl enc -d -aes-256-cbc -a -in /path/to/wallet.dat -out ~/wallet-decrypt.dat

then build bitcoinj and run:

./wallet-tool dump --dump-privkeys --wallet=~/wallet-decrypt.dat > wallet.txt

4: Hex-editor key carving. Bitcoin Core private keys sit in the file behind a recognizable byte pattern. Open the wallet in a hex editor and search for the byte string 0201010420 — the thirty-two bytes that follow are often a raw private key. This also works on fragments of a wallet file carved off a damaged drive, which is why a partially-overwritten wallet is not automatically hopeless. This is the technique we use on the worst cases, automated across the whole drive image.

If the file came off a failing or clicking drive, don't keep flogging the hardware — image it once with ddrescue (or send it in; see our shipment instructions) and work from the image.

Restoring a wallet.dat backup into modern Bitcoin Core

Recent versions of Bitcoin Core are phasing out the legacy Berkeley DB wallet format that every pre-2021 wallet.dat uses. The newest releases can migrate an old wallet but can no longer simply open it:

Restored your wallet, but the balance is zero or too low?

The most common false alarm in Bitcoin Core recovery. Check, in order:

  1. Has the blockchain finished syncing? Bitcoin Core shows no balance until the chain is synced past the date your coins arrived, and a restored wallet may need -rescan to pick up old transactions.
  2. Right file? Many people have several wallet.dat files from different eras. Check each candidate's addresses against a block explorer before concluding the coins are gone.
  3. Pre-2013 backup + missing change: very old wallets pre-generated only 100 spare keys (the "key pool"). If you spent from the wallet after making the backup, change may have gone to keys created after your backup was taken — so an old backup shows less than you expect. The full-drive key-carving approach above recovers those change keys if any copy of the newer wallet data survives.
  4. Right network/coin? A Litecoin or testnet wallet.dat opened in Bitcoin Core shows nothing.

When to stop and get help

Each of these steps destroys evidence if done wrong — an undelete tool writing to the source drive, a salvage run against the only copy of the file, a trojaned pywallet build. The honest rule I give everyone: you get one safe attempt for free; make it count, or make an image first. If the wallet holds more than pocket change and the first careful attempt fails, that's the point to get a free professional evaluation — we do corrupt and deleted wallet-file recovery and Bitcoin Core recovery on a no-recovery, no-fee basis, and we'll tell you honestly if your case isn't worth pursuing.


If this guide helped you recover your Bitcoin, consider sending a tip to 3PoVZA7CZCo8df7WKXZXGskGqTfDacsDah

David Veksler

David Veksler

Founder of WalletRecovery.info and The Bitcoin Consultancy. Working in Bitcoin since 2013; recovering wallets for clients since 2017 as Veksler Consulting LLC (Colorado, USA). About David →